Usage of Class CList


I am reading a good article about yii events by Steven O’Brien at .

But as given in this example I am not able to understand the use of class CList. e.g

in the __set() function we have following lines :

[i]if (!isset($this->_e[$name])) {

$this->_e[$name] = new CList();


return $this->_e[$name]->add($value);

So the property _e[$name] is storing the instance of class CList. But bellow this you have explained that _e is array like :

[i]$_e => array(

‘onUserRegistered’ => array(

0 => array(object, ‘sendMyEmail’)



0 => function(){}

1 => …



I am just confused to see that how _e is an array? it should be an object of class CList.


Anyone please reply