Understanding model creation

Hey Guys,

Im wondering if someone could give me some help.

I’m very new to the Yii framework and im taking over some code for a friend.

Would someone be kiind enough to tell me what the following lines do.




$variable = new ModuleModel('search');

$another->columns = $variable->search()->data;



I’ve never seen something passed when creating a new model instance and im not sure what the ‘data’ call does.

Any help would be greatly appreciated.

Cheers,

The constructor accepts a scenario:

http://www.yiiframework.com/doc/api/1.1/CActiveRecord#__construct-detail

"search()" most likely returns a CDataProvider, which has a "data" property:

http://www.yiiframework.com/doc/api/1.1/CDataProvider#data-detail