/** * Удаление элемента структуры и всех её дочерних элементов. * * @param Structure $oStructure */ private function deepDelete(Structure $oStructure) { /** @var Structure[] $aStructures */ $aStructures = $oStructure->getStructures(); foreach ($aStructures as $oChildStructure) { $this->deepDelete($oChildStructure); } $oStructure->deleted = true; $oStructure->commit(); }
protected function loadMenuItems(Item $MenuItem, Structure $oCurrentStructure) { $aStructures = $oCurrentStructure->getStructures(); foreach ($aStructures as $oStructure) { if (!$oStructure->active || $oStructure->deleted || $oStructure->anchor) { continue; } $MenuItem->addChildItem($oStructure->name, $oStructure->path); $this->loadMenuItems($MenuItem->findChildItemByPath($oStructure->path), $oStructure); } }