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

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

public getAuthorEmail ( )
    public function getAuthorEmail()
    {
        return $this->authorEmail;
    }

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;
 }