コード例 #1
0
 public function safeDown()
 {
     AuthItemChild::deleteAll(['parent' => $this->getRoles()]);
     AuthItemChild::deleteAll(['child' => $this->getRoles()]);
     AuthItem::deleteAll(['name' => $this->getRoles()]);
     return true;
 }
コード例 #2
0
 public function down()
 {
     foreach ($this->getPermissions() as $role => $permissions) {
         AuthItemChild::deleteAll(['parent' => $role, 'child' => $permissions]);
         AuthItem::deleteAll(['name' => $permissions]);
     }
     return true;
 }