/**
  * Gibt die Accountclientmessages der übergebenen AccountId und des Clientmessage Events zurück
  * @param integer $account_id
  * @param \DragonJsonServer\Event\Clientmessages $eventClientmessages
  * @return array
  */
 public function getAccountclientmessagesByAccountIdAndEventClientmessages($account_id, \DragonJsonServer\Event\Clientmessages $eventClientmessages)
 {
     $entityManager = $this->getEntityManager();
     return $entityManager->createQuery('
             SELECT accountclientmessages
             FROM \\DragonJsonServerAccountclientmessage\\Entity\\Accountclientmessage accountclientmessages
             WHERE
                 accountclientmessages.account_id = :account_id
                 AND
                 accountclientmessages.created >= :from
                 AND
                 accountclientmessages.created < :to
                 AND
                 accountclientmessages.key IN (:keys)
             ORDER BY
                 accountclientmessages.created
         ')->execute(['account_id' => $account_id, 'from' => $eventClientmessages->getFrom(), 'to' => $eventClientmessages->getTo(), 'keys' => $eventClientmessages->getKeys()]);
 }
 /**
  * Gibt die Avatarnachrichten für den Avatar und die Clientmessages zurück
  * @param \DragonJsonServerAvatar\Entity\Avatar $avatar
  * @param \DragonJsonServer\Event\Clientmessages $eventClientmessages
  * @return array
  */
 public function getAvatarmessagesByEventClientmessages(\DragonJsonServerAvatar\Entity\Avatar $avatar, \DragonJsonServer\Event\Clientmessages $eventClientmessages)
 {
     $entityManager = $this->getEntityManager();
     return $entityManager->createQuery("\n\t\t\t\tSELECT avatarmessage FROM \\DragonJsonServerAvatarmessage\\Entity\\Avatarmessage avatarmessage\n\t\t\t\tWHERE\n\t\t\t\t\tavatarmessage.to_avatar = :to_avatar_id\n\t\t\t\t\tAND\n\t\t\t\t\tavatarmessage.to_state = 'new'\n\t\t\t\t\tAND\n\t\t\t\t\tavatarmessage.created >= :from AND avatarmessage.created < :to \n\t\t\t")->execute(['to_avatar_id' => $avatar->getAvatarId(), 'from' => $eventClientmessages->getFrom(), 'to' => $eventClientmessages->getTo()]);
 }