yii\rbac\PhpManager::removeChild PHP Метод

removeChild() публичный Метод

public removeChild ( $parent, $child )
    public function removeChild($parent, $child)
    {
        if (isset($this->children[$parent->name][$child->name])) {
            unset($this->children[$parent->name][$child->name]);
            $this->saveItems();
            return true;
        } else {
            return false;
        }
    }

Usage Example

Пример #1
0
 /**
  * @return bool
  */
 public function unChild()
 {
     $item = $this->getItem($this->name, $this->type);
     list($childname, $childtype) = explode('_t', $this->new_child);
     $child = $this->getItem($childname, $childtype);
     if ($child && $this->_authMan->removeChild($item, $child)) {
         // sleep(3); //necessary sleep time  - wait while update auth file
         return true;
     } else {
         return false;
     }
 }