Esempio n. 1
0
 /**
  * Returns all child categories
  *
  * @return null|ObjectStorage $posts
  */
 public function getChildCategories()
 {
     if (!$this->isFirstLevel()) {
         return NULL;
     }
     if ($this->childCategories === NULL) {
         $categories = $this->objectManager->get('TYPO3\\T3extblog\\Domain\\Repository\\CategoryRepository')->findByParentId($this->getUid());
         $this->childCategories = new ObjectStorage();
         foreach ($categories as $category) {
             $this->childCategories->attach($category);
         }
     }
     return $this->childCategories;
 }
Esempio n. 2
0
 /**
  * Adds a Category
  *
  * @param \TYPO3\T3extblog\Domain\Model\Category $category
  *
  * @return void
  */
 public function addCategory(Category $category)
 {
     $this->categories->attach($category);
 }