AppBundle\Entity\Comment::getPost PHP Метод

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

public getPost ( )
    public function getPost()
    {
        return $this->post;
    }

Usage Example

Пример #1
0
 private function canYouDoIt(Comment $comment, User $user)
 {
     $commentOwner = $this->doctrine->getRepository('AppBundle:User')->findOneBy(array('email' => $comment->getAuthorEmail()));
     if (in_array("ROLE_ADMIN", $commentOwner->getRoles()) || $comment->getPost()->getAuthorEmail() !== $user->getEmail()) {
         return false;
     }
     return true;
 }
All Usage Examples Of AppBundle\Entity\Comment::getPost