Ejemplo n.º 1
0
 public function __construct($data = array())
 {
     parent::__construct($data);
     $this->setPropertiesDefine(array('user_group_id' => array('options' => function () {
         $tmp = UserGroup::find('state=?', UserGroup::STATE_ENABLED)->all(true);
         return array_combine(array_column($tmp, 'id'), array_column($tmp, 'name'));
     }, 'display' => function (self $item) {
         $tmp = UserGroup::findOneByPk($item->user_group_id);
         return $tmp->state == UserGroup::STATE_ENABLED ? $tmp->name : "<del>{$tmp->name}</del>";
     }), 'password' => array('type' => 'password')));
 }