listenersInvoker->getSubscribedSystems($class, Events::postLoad); if ($invoke === ListenersInvoker::INVOKE_NONE) { return; } $this->deferredPostLoadInvocations[] = [$class, $invoke, $entity]; } /** * This method should be called after any hydration cycle completed. * * Method fires all deferred invocations of postLoad events */ public function hydrationComplete(): void { $toInvoke = $this->deferredPostLoadInvocations; $this->deferredPostLoadInvocations = []; foreach ($toInvoke as $classAndEntity) { [$class, $invoke, $entity] = $classAndEntity; $this->listenersInvoker->invoke( $class, Events::postLoad, $entity, new PostLoadEventArgs($entity, $this->em), $invoke, ); } } }