예제 #1
0
 /**
  * Удаление элемента структуры и всех её дочерних элементов.
  *
  * @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();
 }
예제 #2
0
 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);
     }
 }