コード例 #1
0
ファイル: MessagesService.php プロジェクト: youshido/messages
 /**
  * @param $user UserInterface
  * @return Author
  */
 private function createAuthor($user)
 {
     $author = new Author();
     $author->setAuthorClass(get_class($user))->setAuthorId($user->getId());
     return $author;
 }
コード例 #2
0
 public function checkExistAuthor(Conversation $conversation, Author $author)
 {
     return $this->createQueryBuilder('r')->select('COUNT(r)')->innerJoin('r.authors', 'authors')->where('authors.id = :author_id')->andWhere('r.id = :id')->setParameter('id', $conversation->getId())->setParameter('author_id', $author->getId())->getQuery()->getSingleScalarResult();
 }