public function getChilds() { if ($this->childs === null) { $childs = parent::getChilds(); $hardLink = $this->getHardLinkSource(); if ($hardLink->getChildsFromSource() && $hardLink->getSourceDocument() && !Pimcore::inAdmin()) { foreach ($childs as &$c) { $c = Document_Hardlink_Service::wrap($c); $c->setHardLinkSource($hardLink); $c->setPath(preg_replace("@^" . preg_quote($hardLink->getSourceDocument()->getFullpath()) . "@", $hardLink->getFullpath(), $c->getPath())); } } $this->setChilds($childs); } return $this->childs; }