Since: 2.0
Author: Alexander Kochetov (creocoder@gmail.com)
Inheritance: extends common\components\XMigration
コード例 #1
0
 /**
  * Override method to allow injection of used authManager from trait.
  * @return \yii\rbac\DbManager
  */
 public function getAuthManager()
 {
     if ($this->authManager !== null) {
         return $this->authManager;
     }
     return parent::getAuthManager();
 }
コード例 #2
0
 public function up()
 {
     parent::up();
     $auth = new \yii\rbac\DbManager();
     $auth->init();
     $holderRole = $auth->createRole('holder');
     $auth->add($holderRole);
     $adminRole = $auth->createRole('administrator');
     $auth->add($adminRole);
 }
コード例 #3
0
 public function down()
 {
     return parent::down();
 }
コード例 #4
0
 /**
  * 使用父类方法撤销 migrate
  */
 public function down()
 {
     parent::down();
 }
コード例 #5
0
 public function down()
 {
     $this->isDbAuth() && parent::down();
 }
コード例 #6
0
 public function down()
 {
     if ($this->isDbManager()) {
         parent::down();
     }
 }