Class Schema

Classes Syntax

As a rule we follow the coding syntax and structure standards outlined by PEAR (http://pear.php.net/manual/en/standards.php). The VO class name space follows closely the PEAR projects structure for classes.

http://pear.php.net/manual/en/standards.naming.php

Class Naming Convention

All classes use camel back with the first letter capitalized e.g. MyClass{}. Classes that are located in Packages or subfolders are separated by the '_' underscore. Packages begin with a uppercase letter and are single words only. If MyClass{} is located in the 'Mail' package or subfolder, then the class is named Mail_MyClass{}.

Class Filenames

The filenames for class files follow the same syntax and style as the class names with one difference. Omit the underscore '_' for classes that are located in package folders. Here is the hierarchy structure of the previous examples.

/classes

    /Mail

        MyClass.php : Mail_MyClass{}

Class Variables

All class variables are lowercase and words are separated by the underscore '_' character. Private variables begin with an 'underscore' character.

public $my_public_variable;
protected $my_protected_variable;
private $_my_private_variable;


Class Methods/Functions

Class methods should use the “studly caps” style (also referred to as “bumpy case” or “camel caps”).

MyClass::login();
MyClass::getAttributes();
MyClass::setAttributes();