Exemplo n.º 1
0
 /**
  * Add search alias to correct search by EmailUser index for Email entity
  *
  * @param SearchAliasesEvent $event
  */
 public function addEmailAliasEvent(SearchAliasesEvent $event)
 {
     $aliases = $event->getAliases();
     if (in_array(Email::ENTITY_CLASS, $event->getTargetClasses(), true)) {
         $aliases[] = 'oro_email';
         $event->setAliases($aliases);
     }
 }
Exemplo n.º 2
0
 public function testEvent()
 {
     $aliases = ['test'];
     $event = new SearchAliasesEvent($aliases, []);
     $this->assertSame($aliases, $event->getAliases());
     $updatedAliases = array_merge($aliases, ['customEntity']);
     $event->setAliases($updatedAliases);
     $this->assertSame($updatedAliases, $event->getAliases());
 }