* [ * 'rules' => [ * \full\namapaced\ClassName, * \another\one\ClassName, * ], * 'permissions' => [ * [ * 'name' => stringName, * 'description' => descriptionText, * 'ruleName' => (new \full\namespaced\ClassName())->name (optional) * ], * [ * 'name' => stringName2, * 'description' => descriptionText2, * 'ruleName' => (new \another\one\ClassName())->name (optional) * ], * ] * ] * * * @var array * @see \common\modules\comment\commands\RbacController */ public $rbac = []; /** * @var \yii\db\Connection Connection to the db */ public $db = null; /** * @inheritdoc */ public function init() { parent::init(); if(\Yii::$app instanceof \yii\console\Application) { $this->controllerNamespace = 'common\modules\comment\commands'; } if($this->db === null) { $this->db = \Yii::$app->db; } elseif(!$this->db instanceof \yii\db\Connection) { throw new \yii\base\InvalidConfigException('Конфиг db обязан наследоваться от'.\yii\db\Connection::className()); } } }