Example #1
0
 /**
  * {@inheritdoc}
  */
 public function __construct()
 {
     parent::__construct();
     if ($this->getPosts()->isEmpty()) {
         $this->addPost(new Post());
     }
 }
Example #2
0
 /**
  * @param Topic $topic
  * 
  * @return Forum
  */
 public function addTopic(Topic $topic)
 {
     $topic->setCategory($this);
     $this->topics->add($topic);
     return $this;
 }