yii\rbac\DbManager::removeRule PHP Method

removeRule() protected method

protected removeRule ( $rule )
    protected function removeRule($rule)
    {
        if (!$this->supportsCascadeUpdate()) {
            $this->db->createCommand()->update($this->itemTable, ['rule_name' => null], ['rule_name' => $rule->name])->execute();
        }
        $this->db->createCommand()->delete($this->ruleTable, ['name' => $rule->name])->execute();
        $this->invalidateCache();
        return true;
    }

Usage Example

Example #1
0
 /**
  * @inheritdoc
  */
 protected function removeRule($rule)
 {
     parent::removeRule($rule);
     if ($this->_rules !== null) {
         unset($this->_rules[$rule->name]);
     }
     $this->_items = null;
     $this->invalidate([self::PART_ITEMS, self::PART_RULES]);
     return true;
 }