Hydrate parent to avoid proxiing it.

@param HydrateEvent $event
164756
public function setParentOnHydrate(HydrateEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof ArticlePageDocument || $document->getParent()) {
            return;
        }

        $parent = $this->documentManager->find(
            $event->getNode()->getParent()->getIdentifier(),
            $document->getOriginalLocale(),
            $event->getOptions()
        );
        $document->setParent($parent);
    }
1074832
public function afterHandle($event)
    {
        parent::afterHandle($event);
        
        // reset form_token
        if ($this->request->getMethod() === 'POST') {
            
            if ($this->errorInfo && !$this->errorInfo['errcode'] && $this->options['csrfTokenEnabled'] && $this->options['csrfTokenAutoReset']) {
                $this->resetCsrfToken();
            }
        }
    }
114756
protected function beforeSave($event)
    {
        if ($this->autoSave) {
            $this->saveFile($this->owner->{$this->uploadAttribute}, $this->name, $this->path);
        }
    }
343524
public function handleStopPropagationAndResetLocale(HydrateEvent $event)
    {
        if (!$event->hasDocument()) {
            return;
        }

        $locale = $event->getLocale();
        $document = $event->getDocument();
        $options = $event->getOptions();
        $originalLocale = $this->documentRegistry->getOriginalLocaleForDocument($document);

        if (
            (!isset($options['rehydrate']) || false === $options['rehydrate']) &&
            (true === $this->documentRegistry->isHydrated($document) && $originalLocale === $locale)
        ) {
            $event->stopPropagation();
        }
    }
705018
public function beforeFilter(Event $event)
    {
        EventManager::trigger('Controller.setup', $this);

        $pluginEvent = Plugin::getData('Core', 'Controller.beforeFilter');
        if (is_callable($pluginEvent->find(0)) && Plugin::hasManifestEvent('Controller.beforeFilter')) {
            call_user_func_array($pluginEvent->find(0), [$this, $event]);
        }
    }
115023
public function beforeFilter(\Cake\Event\Event $event)
    {
        parent::beforeFilter($event);

        $this->loadModel('Settings.Configurations');

        $this->prefixes = Configure::read('Settings.Prefixes');

        $this->Menu->active('ca.settings');
        $this->Menu->area('navbar');

        foreach ($this->prefixes as $prefix => $alias) {
            $this->Menu->add($alias, [
                'url' => [
                    'action' => 'index', $prefix,
                ]
            ]);
        }
    }
804075
protected function handle(Event $event)
    {
        $method = $this->getApplyMethod($event);
        if (!method_exists($this, $method)) {
            return;
        }
        $this->$method($event);
    }
1117275
public function afterSave($event)
    {
        foreach ($this->relationKey as $from => $to) {
            $this->_relation[$to] = $this->owner[$from];
        }
        $this->_relation->save();
    }
705037
public function preRemove(LifecycleEventArgs $event)
    {
        $entity = $event->getEntity();

        if ($entity instanceOf ImageInterface) {
            $this->uploader->remove($entity);
        }
    }
48749
public function onBeforeRedirect(Event $event)
    {
        /**
         * @var Container $container
         * @var Collector $collector
         * @var Profiler  $profiler
         */
        $container = $event['app']->getContainer();
        $collector = $container->get('debugger.collector');
        $profiler  = $container->get('profiler');

        $collector['redirect'] = [
            'url' => $event['url'],
            'moved' => $event['moved'],
        ];
    }
1226217
private function rehydrateDocument($document, NodeInterface $node, $locale)
    {
        $hydrateEvent = new HydrateEvent($node, $locale, ['rehydrate' => true]);
        $hydrateEvent->setDocument($document);
        $this->eventDispatcher->dispatch(Events::HYDRATE, $hydrateEvent);
    }
817162
public function handle(GetGroupHeaderEvent $event)
    {
        if ((null !== $event->getValue()) || !$this->scopeDeterminator->currentScopeIsBackend()) {
            return;
        }

        $environment = $event->getEnvironment();
        $property    = $environment
            ->getDataDefinition()
            ->getPropertiesDefinition()
            ->getProperty($event->getGroupField());

        // No property? Get out!
        if (!$property) {
            $event->setValue('-');
            return;
        }

        $value = $this->formatGroupHeader(
            $environment,
            $event->getModel(),
            $property,
            $event->getGroupingMode(),
            $event->getGroupingLength()
        );

        if (null !== $value) {
            $event->setValue($value);
        }
    }
49109
protected function handle($event): void
    {
        $method = $this->getApplyMethod($event);

        if (!method_exists($this, $method)) {
            return;
        }

        $this->$method($event);
    }
122841
public function beforeFilter(Event $event)
    {
        $this->controller = $event->getSubject();
        $this->request = $this->controller->request;
        $this->action = $this->request->getParam('action');
        $this->Filters = TableRegistry::get($this->getConfig('filterTable'));

        $this->_setupSort();
        $this->_setupFilters();
        $this->_setupPagination();
    }
1070387
protected function hydrateEvent(array $i18nRow, CustomerTitleEvent $event)
    {
        $event
            ->setShort($i18nRow["short"])
            ->setLong($i18nRow["long"])
            ->setLocale($i18nRow["locale"])
        ;
    }
1144217
public function beforeSave(Event $event)
    {
        if (isset($this->_controller()->request->data['password'])) {
            $password = $this->_controller()->request->data['password'];
            $event->subject->entity['password'] = $password;
        }
    }
1191229
public function handle(DomainEvent $event) : void {
        $this->projections->each(function (Projection $projection) use ($event) {
            $projection->handle($event);
        });
    }