Newscoop\Services\CommentService::isBanned PHP Метод

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

Checks if a commenter is banned
public isBanned ( Newscoop\Entity\Comment\Commenter $commenter ) : boolean
$commenter Newscoop\Entity\Comment\Commenter Commenter
Результат boolean
    public function isBanned($commenter)
    {
        if ($commenter->getUser() != null) {
            $commenter->setName($commenter->getUser()->getUsername());
        }
        $publication = $this->publicationService->getPublication();
        $results = $this->em->getRepository('Newscoop\\Entity\\Comment\\Acceptance')->isBanned($commenter, $publication);
        $result = count(array_intersect(array(true), $results));
        if ($result > 0) {
            return true;
        }
        return false;
    }