示例#1
0
 private function collectTagsByChild(Tag $tag, $list)
 {
     $list[] = $tag;
     foreach ($tag->getChildren() as $child) {
         $list = $this->collectTagsByChild($child, $list);
     }
     return $list;
 }
示例#2
0
文件: Tag.php 项目: ErikRoelofs/Phorg
 public function getPrimaryParent()
 {
     foreach ($this->getParentRelations() as $parentRelation) {
         if ($parentRelation->getPrimaryParent()) {
             return $parentRelation->getParent();
         }
     }
     // this is a root node; return a (non-saved) ROOT tag
     $parent = new Tag();
     $parent->setName("ROOT");
     return $parent;
 }
示例#3
0
 private function getAllMetaFor(Tag $tag, $metaList = array())
 {
     foreach ($tag->getProtoMeta() as $meta) {
         $metaList[] = $meta;
     }
     foreach ($tag->getParents() as $ptag) {
         $metaList = $this->getAllMetaFor($ptag, $metaList);
     }
     return $metaList;
 }