예제 #1
0
 private function doGetChildren(Document $document)
 {
     $children = $document->getChilds();
     foreach ($children as $child) {
         if ($child instanceof Document\Printpage) {
             $this->allChildren[] = $child;
         }
         if ($child instanceof Document\Folder || $child instanceof Document\Printcontainer) {
             $this->doGetChildren($child);
         }
         if ($child instanceof Document\Hardlink) {
             if ($child->getSourceDocument() instanceof Document\Printpage) {
                 $this->allChildren[] = $child;
             }
             $this->doGetChildren($child);
         }
     }
 }
예제 #2
0
파일: Hardlink.php 프로젝트: sfie/pimcore
 /**
  * @param bool $unpublished
  * @return array|null
  */
 public function getChilds($unpublished = false)
 {
     if ($this->childs === null) {
         $childs = parent::getChilds();
         $sourceChilds = array();
         if ($this->getChildsFromSource() && $this->getSourceDocument() && !\Pimcore::inAdmin()) {
             $sourceChilds = $this->getSourceDocument()->getChilds();
             foreach ($sourceChilds as &$c) {
                 $c = Document\Hardlink\Service::wrap($c);
                 $c->setHardLinkSource($this);
                 $c->setPath(preg_replace("@^" . preg_quote($this->getSourceDocument()->getFullpath()) . "@", $this->getFullpath(), $c->getPath()));
             }
         }
         $childs = array_merge($sourceChilds, $childs);
         $this->setChilds($childs);
     }
     return $this->childs;
 }
예제 #3
0
 /**
  * @param Document $parentDocument
  * @return Document[]
  */
 protected function getChilds($parentDocument)
 {
     return $parentDocument->getChilds();
 }