protected getChildrenList ( ) : array | ||
리턴 | 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;
}
/** * @inheritdoc */ protected function getChildrenList() { if ($this->_childrenList === null) { $this->_childrenList = parent::getChildrenList(); } return $this->_childrenList; }