Example #1
0
 public function create($parentId, $caption)
 {
     $tagCategory = new Type($this->getDataSource());
     $tagCategory->setValue('parent_id', $parentId);
     $tagCategory->setValue('caption', $caption);
     $tagCategory->insert();
     $rootCategory = new Type($this->getDataSource());
     $rootCategory->loadBy('qname', 'default');
     $tagCategory->buildTree($rootCategory->getId(), true);
     return $tagCategory->getValues();
 }