Newscoop\ArticlesBundle\Entity\EditorialComment::setArticle PHP Метод

setArticle() публичный Метод

Sets the }).
public setArticle ( mixed $article ) : self
$article mixed the article
Результат self
    public function setArticle($article)
    {
        $this->article = $article;
        return $this;
    }

Usage Example

 /**
  * Create new editorial comment for Article
  *
  * @param string                   $commentContent
  * @param Article                  $article
  * @param User                     $user
  * @param EditorialComment\null    $parrentComment
  */
 public function create($commentContent, Article $article, User $user, $parrentComment = null)
 {
     $editorialComment = new EditorialComment();
     $editorialComment->setComment($commentContent);
     $editorialComment->setUser($user);
     $editorialComment->setArticle($article);
     if ($parrentComment) {
         $editorialComment->setParent($parrentComment);
     }
     $this->em->persist($editorialComment);
     $this->em->flush();
     return $editorialComment;
 }