public function init() { parent::init(); if (!$this->tree_model instanceof ActiveRecord) { throw new CException('Needs param tree_model instanceof ActiveRecord!'); } }
public function init() { $class = 'application.components.activeRecordBehaviors.MetaTagBehavior'; $behaviors = $this->model->behaviors(); $classes = ArrayHelper::extract($behaviors, 'class'); if (!in_array($class, $classes)) { throw new CException("Модель должна иметь поведение: {$class}"); } parent::init(); }
public function init() { parent::init(); if (!$this->model instanceof ActiveRecord) { throw new CException(t('Needs param model instanceof ActiveRecord!')); } if (!$this->attribute) { throw new CException(t('Needs param attribute!')); } if (!is_array($this->items)) { throw new CException(t('Needs param items typeof Array!')); } }
public function init() { parent::init(); $behaviorAttached = false; foreach ($this->model->behaviors() as $id => $data) { if ($this->model->asa($id) instanceof FileManagerBehavior) { $behaviorAttached = true; break; } } if (!$behaviorAttached) { throw new CException('Требуется подключение behavior FileManagerBehavior в моделе!'); } $this->initVars(); $this->registerScripts(); }
public function init() { parent::init(); $this->registerScripts(); }