public function hydrate(HydrationEvent $event, $eventName, $eventDispatcher)
    {
        // Possibility to load serialized cache
        $eventDispatcher->dispatch(TmdbEvents::BEFORE_HYDRATION, $event);

        if ($event->isPropagationStopped()) {
            return $event->getSubject();
        }

        $subject = $this->hydrateSubject($event);
        $event->setSubject($subject);

        // Possibility to cache the data
        $eventDispatcher->dispatch(TmdbEvents::AFTER_HYDRATION, $event);

        return $event->getSubject();
    }
public function hydrate(HydrationEvent $event, $eventName, $eventDispatcher)
    {
        // Possibility to load serialized cache
        $eventDispatcher->dispatch(TmdbEvents::BEFORE_HYDRATION, $event);

        if ($event->isPropagationStopped()) {
            return $event->getSubject();
        }

        $subject = $this->hydrateSubject($event);
        $event->setSubject($subject);

        // Possibility to cache the data
        $eventDispatcher->dispatch(TmdbEvents::AFTER_HYDRATION, $event);

        return $event->getSubject();
    }
public function hydrate ( HydrationEvent $ event , $ eventName , $ eventDispatcher ) { // Possibility to load serialized cache $ eventDispatcher -> dispatch ( TmdbEvents :: BEFORE_HYDRATION , $ event ) ; if ( $ event -> isPropagationStopped ( ) ) { return $ event -> getSubject ( ) ; } $ subject = $ this -> hydrateSubject ( $ event ) ; $ event -> setSubject ( $ subject ) ; // Possibility to cache the data $ eventDispatcher -> dispatch ( TmdbEvents :: AFTER_HYDRATION , $ event ) ; return $ event -> getSubject ( ) ; }
Hydrate the subject with data

@param HydrationEvent           $event
@param string                   $eventName
@param EventDispatcherInterface $eventDispatcher

@return \Tmdb\Model\AbstractModel
Hydrate the subject with data