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