public function testEvent()
 {
     $targetClass = 'testClass';
     $targetId = 1;
     $targetIds = [2, 3];
     $event = new ActivityListPreQueryBuildEvent($targetClass, $targetId);
     $this->assertEquals($targetId, $event->getTargetId());
     $this->assertEquals([$targetId], $event->getTargetIds());
     $this->assertEquals($targetClass, $event->getTargetClass());
     $event = new ActivityListPreQueryBuildEvent($targetClass, $targetId);
     $event->setTargetIds($targetIds);
     $this->assertEquals($targetIds, $event->getTargetIds());
 }
 /**
  * Add email thread ids to qb params
  *
  * @param ActivityListPreQueryBuildEvent $event
  */
 public function prepareIdsForEmailThreadEvent(ActivityListPreQueryBuildEvent $event)
 {
     if ($event->getTargetClass() === Email::ENTITY_CLASS) {
         /** @var Email $email */
         $email = $this->doctrineHelper->getEntity(Email::ENTITY_CLASS, $event->getTargetId());
         if ($email->getThread()) {
             $emailIds = array_map(function ($emailEntity) {
                 return $emailEntity->getId();
             }, $email->getThread()->getEmails()->toArray());
             $event->setTargetIds($emailIds);
         }
     }
 }