Coding standards - Naming Conventions - Constants.php 657 Bytes
Newer Older
hansbrix's avatar
hansbrix committed
1
Following rules must apply to all constants used within Doctrine framework:
2

hansbrix's avatar
hansbrix committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
*  Constants may contain both alphanumeric characters and the underscore.

*  Constants must always have all letters capitalized.

*  For readablity reasons, words in constant names must be separated by underscore characters. For example, ATTR_EXC_LOGGING is permitted but ATTR_EXCLOGGING is not.

*  Constants must be defined as class members by using the "const" construct. Defining constants in the global scope with "define" is NOT permitted.


<code type="php">
class Doctrine_SomeClass {
    const MY_CONSTANT = 'something';
}
print Doctrine_SomeClass::MY_CONSTANT;
</code>