/**
  * @param FindEvent $event
  *
  * @throws DocumentManagerException
  * @throws DocumentNotFoundException
  */
 public function handleFind(FindEvent $event)
 {
     $options = $event->getOptions();
     $aliasOrClass = $options['type'];
     $node = $this->nodeManager->find($event->getId());
     $hydrateEvent = new HydrateEvent($node, $event->getLocale(), $options);
     $this->eventDispatcher->dispatch(Events::HYDRATE, $hydrateEvent);
     $document = $hydrateEvent->getDocument();
     if ($aliasOrClass) {
         $this->checkAliasOrClass($aliasOrClass, $document);
     }
     $event->setDocument($hydrateEvent->getDocument());
 }
 public function handleFind(FindEvent $event)
 {
     $this->find = true;
     $event->setDocument(new \stdClass());
 }