public function init() { $this->name = "Управление агентами"; $this->modelShowAttribute = "id"; $this->modelClassName = CmsAgent::className(); parent::init(); }
/** * Выполнить агентов */ public function actionAgentsExecute() { /** * Поиск агентов к выполнению */ $agents = CmsAgent::findForExecute()->all(); \Yii::info('Agents execute: ' . count($agents), CmsAgent::className()); if ($agents) { foreach ($agents as $agent) { $agent->execute(); } } }