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__);
}
}
```[...]