Revision #2 has been created by briiC.lv on Dec 10, 2011, 8:45:10 AM with the memo:
public function => public static function (thanks to twisted1919)
« previous (#1)
Changes
Title
unchanged
Managing constants easily
Category
unchanged
Tips
Yii version
unchanged
Tags
unchanged
model, constant, constants
Content
changed
[...]
### getConstants()
For this small problem i am using function **getConstants()**.
```php
public static function getConstants($token,$objectClass) {
$tokenLen = strlen($token);[...]
Class::getConstants('MY_STATUS');
*/
public static function getConstants($token,$objectClass) {
$tokenLen = strlen($token);[...]
}
//..
public static function getStatuses() {
return self::getConstants('STATUS_',__CLASS__);
}
public
static function getTypes() {
return self::getConstants('TYPE_',__CLASS__);
}
}
```[...]