public function load(array $seeds)
 {
     foreach ($seeds as $seed) {
         foreach ($seed as $childName => $parentGroup) {
             $path = Vector::create(Name::create($childName))->merge(self::parseTagsGroup($parentGroup))->reverse();
             $this->createPath($path);
         }
         // 			$child = $this->findOrAdd(array($childName));
         // 			if ($parentGroup) {
         // 				$path = self::parseTagsGroup($parentGroup)
         // 					->reverse();
         // 				$parents = $this->findByPath($path);
         // 				if ($parents->isEmpty())
         // 					$this->createPath($path, $parents);
         // 				foreach ($parents as $parent)
         // 					$parent->addChild($child)->save();
         // 			} else {
         // 				$child = $this->findOrAdd(array($childName));
         // 			}
         // 			if ($parentName) $this->findOrAdd(Array($parentName))->addChild($child)->save();
     }
     return $this;
 }
示例#2
0
 public function setName($name)
 {
     $this->name = Name::create($name);
     $this->changed = true;
     return $this;
 }