Resolve content on serialization.

@param ObjectEvent $event
492836
public function resolveContentForArticlePageOnPostSerialize(ObjectEvent $event)
    {
        $article = $event->getObject();
        $visitor = $event->getVisitor();
        $context = $event->getContext();

        if (!$article instanceof ArticlePageDocument || !$context->attributes->containsKey('website')) {
            return;
        }

        $content = $this->resolve($article);
        foreach ($content as $name => $value) {
            $visitor->addData($name, $value);
        }
    }
1145123
public function onPreRenderContent(RendererEvent $event)
    {
        // Checks if content caching is available
        $this->object = $event->getTarget();

        if (false === ($this->object instanceof AbstractClassContent) || false === $this->checkCacheContentEvent()) {
            return;
        }

        $renderer = $event->getRenderer();
        // Checks if cache data is available
        $cache_id = $this->getContentCacheId($renderer);
        if (false === $data = $this->cache_content->load($cache_id)) {
            return;
        }

        $renderer->setRender($data);
        $event->getDispatcher()->dispatch('cache.postrender', new Event($this->object, array($renderer, $data)));
        $this->application->debug(sprintf(
            'Found cache (id: %s) for rendering `%s(%s)` with mode `%s`.',
            $cache_id,
            get_class($this->object),
            $this->object->getUid(),
            $renderer->getMode()
        ));
    }
832258
public static function onFlushContent(Event $event)
    {
        $content = $event->getTarget();
        if (!($content instanceof AbstractClassContent)) {
            return;
        }

        $page = $content->getMainNode();
        if (null === $page) {
            return;
        }

        $newEvent = new Event($page, $content);
        $newEvent->setDispatcher($event->getDispatcher());
        self::onFlushPage($newEvent);
    }
689948
public function onPreSerialize(ObjectEvent $event)
    {
        $configuredType = $event->getObject();

        if ($configuredType instanceof ConfiguredType) {
            try {
                $configurationArray = json_decode($configuredType->getConfiguration(), true);
                $extraFormType = $this->registry->getType($configurationArray['form_type']);
                $configuredType->setExtraFormType($extraFormType);
            } catch (\Exception $e) {
                return;
            }
        }
    }
149486
public function setStructureTypeToParent(PersistEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof ArticlePageDocument
            || LocalizationState::GHOST === $this->documentInspector->getLocalizationState($document->getParent())
            || $document->getStructureType() === $document->getParent()->getStructureType()
        ) {
            return;
        }

        $document->getParent()->setStructureType($document->getStructureType());
        $this->documentManager->persist($document->getParent(), $event->getLocale());
    }
1203427
function resolveEvents(oEvents) {
			if ( oEvents != null && typeof oEvents === 'object' ) {
				for ( var sName in oEvents ) {
					resolveRef(oEvents, sName);
				}
			}
		}
1080875
public function onAfterRespond(Event $event)
    {
        /** @var ResponseInterface $response */
        $response = $event['response'];

        if (strpos($response->getHeaderLine('Content-Type'), 'html') === false) {
            DebuggerHelper::disableConsole();
        }
    }
264390
public function dispatchEvent(object $event): object
    {
        if (isset($this->i__dispatcher)) {
            $this->i__dispatcher->dispatch($event);
        }

        return $event;
    }
1367213
public function onPostSerialize(ObjectEvent $event)
    {
        $visitor = $event->getVisitor();
        $document = $event->getObject();

        if (!$document instanceof ParentBehavior || !$document->getParent() instanceof UuidBehavior) {
            return;
        }

        $visitor->addData('parentUuid', $document->getParent()->getUuid());
    }
831712
public function addBrokenIndicatorOnPostSerialize(ObjectEvent $event)
    {
        $article = $event->getObject();
        $visitor = $event->getVisitor();

        if (!($article instanceof ArticleViewDocumentInterface)) {
            return;
        }

        $structure = $this->structureManager->getStructure($article->getStructureType(), 'article');
        $visitor->addData('broken', !$structure || $structure->getKey() !== $article->getStructureType());
        $visitor->addData('originalStructureType', $article->getStructureType());
    }
894660
public function beforeMarshal(Event $event, ArrayObject $data, ArrayObject $options) : void
    {
        // @todo this will be removed once saved searches table schema is adjusted
        $saved = Hash::get($data, 'content.saved', []);
        if (! empty($saved)) {
            $data['content']['latest'] = $saved;
        }
    }
122758
public function onTaskSerialize(ObjectEvent $event)
    {
        $object = $event->getObject();
        if (!$object instanceof TaskInterface) {
            return;
        }

        $handler = $this->handlerFactory->create($object->getHandlerClass());
        if ($handler instanceof AutomationTaskHandlerInterface) {
            $event->getVisitor()->addData('taskName', $handler->getConfiguration()->getTitle());
        }

        $executions = $this->taskExecutionRepository->findByTaskUuid($object->getTaskId());
        if (0 < count($executions)) {
            $event->getVisitor()->addData('status', $executions[0]->getStatus());
        }
    }
268284
public function onPostSerialize(ObjectEvent $event)
    {
        // getSubscribedEvents doesn't seem to support parent classes
        if (!$event->getObject() instanceof MediaInterface) {
            return;
        }

        /** @var MediaInterface $media */
        $media = $event->getObject();

        $provider = $this->getProvider($media);

        if ($provider->getName() == 'image') {
            $images = $this->getImages($media, ['medialibrary']);

            $event->getVisitor()->addData('images', $images);
        }

        $event->getVisitor()->addData('original', $provider->getUrl($media));
    }
968818
public function handleParseDate($event)
    {
        if ($event->getResult() === null) {
            /** @var Date $dateAdapter */
            $dateAdapter = $this->framework->getAdapter(Date::class);
            $event->setResult($dateAdapter->parse($event->getFormat(), $event->getTimestamp()));
        }
    }
1342807
public function handlePersist(PersistEvent $event)
    {
        $document = $event->getDocument();
        $node = $event->getNode();
        $propertyName = $this->propertyEncoder->systemName(static::FIELD);
        if (!$document instanceof PageBehavior) {
            return;
        }

        $parentDocument = $document->getParent();

        $page = 1;
        foreach ($parentDocument->getChildren() as $child) {
            if (!$child instanceof PageBehavior) {
                continue;
            }

            ++$page;

            if ($child === $document) {
                break;
            }
        }

        $node->setProperty($propertyName, $page);
        $document->setPageNumber($page);
    }
85211
public function setEvent($event)
  {
    if ($event === '?' || $event === '') {
      $this->event = null;
    } else {
      $event = Util::foreignLettersToEnglishLetters($event);
      $event = Util::titleCaseIfCurrentlyAllCaps($event);
      $this->event = $event === '?' ? null : $event;
    }
  }
122261
private function resolveAndAddType(ObjectTypeInterface $type): void
    {
        $parentType = $type->getParent();
        $typeExtensions = [];

        foreach ($this->extensions as $extension) {
            /** @var ObjectExtensionInterface $extension */
            $typeExtensions = array_merge(
                $typeExtensions,
                $extension->getTypeExtensions('default'),
                $extension->getTypeExtensions($type->getClass())
            );
        }

        $parent = $parentType ? $this->getType($parentType) : null;
        $rType = $this->resolvedTypeFactory->createResolvedType($type, $typeExtensions, $parent);

        $this->types[$type->getClass()] = $rType;
    }