public function membersList(ConversationInterface $conversation, PersonInterface $differentFrom = null)
 {
     $otherMembersUsernames = [];
     foreach ($conversation->getConversationPersons() as $conversationPerson) {
         if ($conversationPerson->getPerson()->getId() != $differentFrom->getId()) {
             $otherMembersUsernames[] = $conversationPerson->getPerson()->getUsername();
         }
     }
     return implode(', ', $otherMembersUsernames);
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function findConversationPerson(ConversationInterface $conversation, PersonInterface $person)
 {
     return $this->objectManager->createQueryBuilder()->select('cp', 'c', 'p', 't')->from($this->getConversationPersonClass(), 'cp')->innerJoin('cp.conversation', 'c')->innerJoin('cp.person', 'p')->leftJoin('cp.tags', 't')->where('c.id = :conversation')->setParameter('conversation', $conversation->getId())->andWhere('p.id = :person')->setParameter('person', $person->getId())->setMaxResults(1)->getQuery()->getOneOrNullResult();
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function isPersonInConversation(PersonInterface $person)
 {
     foreach ($this->persons as $conversationPerson) {
         if ($conversationPerson->getPerson()->getId() === $person->getId()) {
             return true;
         }
     }
     return false;
 }