yii\rbac\DbManager::getChildrenList PHP Method

getChildrenList() protected method

Returns the children for every parent.
protected getChildrenList ( ) : array
return array the children list. Each array key is a parent item name, and the corresponding array value is a list of child item names.
    protected function getChildrenList()
    {
        $query = (new Query())->from($this->itemChildTable);
        $parents = [];
        foreach ($query->all($this->db) as $row) {
            $parents[$row['parent']][] = $row['child'];
        }
        return $parents;
    }

Usage Example

Beispiel #1
0
 /**
  * @inheritdoc
  */
 protected function getChildrenList()
 {
     if ($this->_childrenList === null) {
         $this->_childrenList = parent::getChildrenList();
     }
     return $this->_childrenList;
 }
All Usage Examples Of yii\rbac\DbManager::getChildrenList