2006-10-01 17:58:19 +04:00
|
|
|
Following rules must apply to all constants used within Doctrine framework:
|
|
|
|
|
|
|
|
<ul><li \> Constants may contain both alphanumeric characters and the underscore.</ul>
|
|
|
|
|
|
|
|
<ul><li \> Constants must always have all letters capitalized.</ul>
|
|
|
|
|
|
|
|
<ul><li \> 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.
|
|
|
|
</ul>
|
|
|
|
<ul><li \> Constants must be defined as class members by using the "const" construct. Defining constants in the global scope with "define" is NOT permitted.
|
|
|
|
</ul>
|
2007-04-13 00:52:30 +04:00
|
|
|
|
|
|
|
<code type="php">
|
|
|
|
class Doctrine_SomeClass {
|
|
|
|
const MY_CONSTANT = 'something';
|
|
|
|
}
|
|
|
|
print Doctrine_SomeClass::MY_CONSTANT;
|
|
|
|
</code>
|