コード例 #1
0
ファイル: User.php プロジェクト: warhuhn/log-blog
 /**
  * Adds a post top the User's authored Posts.
  *
  * Post Author needs to be updated manually.
  *
  * @param Post $addPost
  * @return User
  */
 public function addPost(Post $addPost)
 {
     if (!$this->getAuthoredPosts()->contains($addPost)) {
         $this->authoredPosts->add($addPost);
     }
     return $this;
 }
コード例 #2
0
ファイル: Category.php プロジェクト: prevueltas/blog-bundle
 /**
  * @param Post $post
  */
 public function removePost(Post $post)
 {
     $this->posts->removeElement($post);
 }
コード例 #3
0
 /**
  * @param Post $post
  * @return $this
  */
 public function removePost(Post $post)
 {
     $this->posts->remove($post);
     return $this;
 }
コード例 #4
0
ファイル: User.php プロジェクト: nebuchar/ddd-blog
 public function hasPost(Post $post)
 {
     return $this->posts->contains($post);
 }
コード例 #5
0
ファイル: Post.php プロジェクト: Grugg/symfony-workshop
 /**
  * Remove comments
  *
  * @param \Workshop\Bundle\BackendBundle\Entity\Comment $comments
  */
 public function removeComment(\Workshop\Bundle\BackendBundle\Entity\Comment $comments)
 {
     $this->comments->removeElement($comments);
 }
コード例 #6
0
 /**
  * Remove posts
  *
  * @param \Workshop\Bundle\BackendBundle\Entity\Post $posts
  */
 public function removePost(\Workshop\Bundle\BackendBundle\Entity\Post $posts)
 {
     $this->posts->removeElement($posts);
 }