예제 #1
0
파일: Topic.php 프로젝트: courtyard/forum
 /**
  * Add post
  *
  * @param Courtyard\Forum\Entity\Post $post
  * @return Topic
  */
 public function addPost(PostInterface $post)
 {
     $post->setTopic($this);
     $this->posts[] = $post;
     $this->postLast = $post;
     return $this;
 }
예제 #2
0
 public function add(PostInterface $post)
 {
     $this->posts[$post->getId()] = $post;
 }
예제 #3
0
 /**
  * @param PostInterface $post
  */
 public function preUpdate($post)
 {
     $post->setContent($this->getPoolFormatter()->transform($post->getContentFormatter(), $post->getRawContent()));
 }
예제 #4
0
 /**
  * contains.
  *
  * @param PostInterface $item
  *
  * @return bool
  */
 public function contains(PostInterface $item)
 {
     return in_array($item->getUniqueIdentifier(), array_keys($this->feedArray), true);
 }