Versions
Look up a class, method, property or event

CEnumerable

Package system.base
Inheritance class CEnumerable
Since 1.0
Version $Id: CComponent.php 1465 2009-10-17 11:06:11Z qiang.xue $
CEnumerable is the base class for all enumerable types.

To define an enumerable type, extend CEnumberable and define string constants. Each constant represents an enumerable value. The constant name must be the same as the constant value. For example,
class TextAlign extends CEnumerable
{
    const Left='Left';
    const Right='Right';
}
Then, one can use the enumerable values such as TextAlign::Left and TextAlign::Right.

Be the first person to leave a comment

Please to leave your comment.