AppBundle\Entity\Post::getComments PHP Метод

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

public getComments ( )
    public function getComments()
    {
        return $this->comments;
    }

Usage Example

Пример #1
0
 /**
  * Send email to author and all people from comments when vote is Approved or Rejected
  *
  * @param Post   $post
  * @param string $translation
  * @param string $template
  */
 private function sendPostVoteClosedEmail(Post $post, $translation, $template)
 {
     $recipients[] = $post->getAuthor()->getEmail();
     /** @var Comment $comment */
     $comments = $post->getComments();
     foreach ($comments as $comment) {
         $recipients[] = $comment->getUser()->getEmail();
     }
     $subject = $this->translator->trans($translation);
     $body = $this->renderView($template, array('post' => $post));
     $this->mailer->send($recipients, $subject, $body);
 }
All Usage Examples Of AppBundle\Entity\Post::getComments