Clears cached data associated to the content to be flushed.

@param \BackBee\Event\Event $event
547971
public function onFlushContent(Event $event)
    {
        // Checks if page caching is available
        $this->object = $event->getTarget();
        if (false === ($this->object instanceof AbstractClassContent) || false === $this->checkCacheContentEvent(false)) {
            return;
        }

        $parent_uids = $this->application->getEntityManager()
            ->getRepository('BackBee\ClassContent\Indexes\IdxContentContent')
            ->getParentContentUids(array($this->object))
        ;

        $content_uids = array_diff($parent_uids, $this->content_cache_deletion_done);
        if (0 === count($content_uids)) {
            return;
        }

        $this->cache_content->removeByTag($content_uids);
        $this->content_cache_deletion_done = array_merge($this->content_cache_deletion_done, $content_uids);
        $this->application->debug(sprintf(
            'Remove cache for `%s(%s)`.',
            get_class($this->object),
            implode(', ', $content_uids)
        ));

        if (false === $this->application->getContainer()->has('cache.page')) {
            return;
        }

        $cachePage = $this->application->getContainer()->get('cache.page');
        if ($cachePage instanceof CacheExtendedInterface) {
            $node_uids = $this->application->getEntityManager()
                ->getRepository('BackBee\ClassContent\Indexes\IdxContentContent')
                ->getNodeUids($content_uids)
            ;
            $cachePage->removeByTag($node_uids);
            $this->application->debug(sprintf('Remove cache for page %s.', implode(', ', $node_uids)));
        }
    }
451743
public function handleFlushLive(FlushEvent $event)
    {
        if (count($this->liveDocuments) < 1) {
            return;
        }

        foreach ($this->liveDocuments as $documentData) {
            $document = $this->documentManager->find($documentData['uuid'], $documentData['locale']);
            $this->documentManager->refresh($document);

            $this->liveIndexer->index($document);
        }
        $this->liveIndexer->flush();
        $this->liveDocuments = [];
    }
485806
public function onContentChanged($event)
    {
        $sender = $event->sender;
        // If it is permitted to change content, then it will return directly.
        if ($sender->permitChangeContent) {
            return;
        }
        // The messgage will be reversed if it changed (current message isn't
        // same as the old).
        $cAttribute = $sender->contentAttribute;
        $oldContent = $sender->getOldAttribute($cAttribute);
        if ($oldContent != $sender->$cAttribute) {
            $sender->$cAttribute = $oldContent;
        }
    }
998842
public function remove(EventInterface $event)
    {
        $index = $this->computeIndex($event);
        if (isset($this->events[$index])) {
            foreach ($this->events[$index] as $key => $internalEvent) {
                if ($event->getUid() == $internalEvent->getUid()) {
                    unset($this->events[$index][$key]);
                    --$this->count;
                }
            }
        }
    }
932707
public function recordThat(Event $event): void
    {
        $this->handleRecursively($event);
        parent::recordThat($event);
    }
1360413
public function deleteDoctrineCache(SiteEvent $event)
    {
        if ($cacheImpl = $this->em->getConfiguration()->getResultCacheImpl()) {
            $cacheImpl->delete(SiteInterface::SITE);
        }
    }
637512
public function afterDelete( $event ) {
        $synchronizer = $this->getSynchonizer();
        foreach ( $this->syncServices as $serviceName ) {
            $synchronizer->deleteSyncModel( $serviceName, $event->sender, $this->syncDelete );
        }
    }
989884
public static function clearCache(Event $event)
    {
        $options = self::getOptions($event);
        $binDir = $options['symfony-bin-dir'];

        $opcode = '';
        if (array_key_exists('accelerator-cache-opcode', $options)) {
            $opcode .= ' --opcode';
        }

        $user = '';
        if (array_key_exists('accelerator-cache-user', $options)) {
            $user .= ' --user';
        }

        $cli = '';
        if (array_key_exists('accelerator-cache-cli', $options)) {
            $cli .= ' --cli';
        }

        $auth = '';
        if (array_key_exists('accelerator-cache-auth', $options)) {
            $auth .= ' --auth '.escapeshellarg($options['accelerator-cache-auth']);
        }

        try {
            static::executeCommand($event, $binDir, 'cache:accelerator:clear'.$opcode.$user.$cli.$auth, $options['process-timeout']);
        } catch (\RuntimeException $e) {
            $event->getIO()->write('<error>'.$e->getMessage().'</error>');
        }
    }
1124113
function clear( $flush = false ) {
            $this->_logger->entrance();

            $this->_options = array();

            if ( $flush ) {
                $this->store();
            }
        }
1149237
public function handlePreRemove(RemoveEvent $event)
    {
        $document = $event->getDocument();

        if (!$this->supports($document)) {
            return;
        }

        $event = $this->getDeleteEvent($document);
        $this->deleteEvents[spl_object_hash($document)] = $event;
        $this->eventDispatcher->dispatch(
            ContentEvents::NODE_PRE_DELETE,
            $event
        );
    }
1256370
public function handleRemoveLive($event)
    {
        $document = $event->getDocument();
        if (!$document instanceof ArticleDocument) {
            return;
        }

        $this->liveIndexer->remove($document);
        $this->liveIndexer->flush();
    }
821996
public function remove(EventInterface $event)
    {
        foreach ($this->events as $key => $internalEvent) {
            if ($event->getUid() === $internalEvent->getUid()) {
                unset($this->events[$key]);
            }
        }
    }
1017453
public function onAfterInitialise(Event $event): void
    {
        /** @var WebApplication $app */
        $app = $event['app'];

        // Remove index.php
        if ($app->uri->script === 'index.php') {
            $app->uri->script = null;
        }
    }
813123
public static function onFlushPage(Event $event)
    {
        if (self::$onFlushPageAlreadyCalled) {
            return;
        }

        $page = $event->getTarget();
        if (!($page instanceof Page)) {
            return;
        }

        $application = $event->getApplication();
        $em = $application->getEntityManager();
        $uow = $em->getUnitOfWork();
        if ($uow->isScheduledForDelete($page)) {
            return;
        }

        $metadata = $application->getContainer()->get('nestednode.metadata.resolver')->resolve($page);
        $page->setMetaData($metadata);

        if ($uow->isScheduledForInsert($page) || $uow->isScheduledForUpdate($page)) {
            $uow->recomputeSingleEntityChangeSet($em->getClassMetadata('BackBee\NestedNode\Page'), $page);
        } elseif (!$uow->isScheduledForDelete($page)) {
            $uow->computeChangeSet($em->getClassMetadata('BackBee\NestedNode\Page'), $page);
        }

        self::$onFlushPageAlreadyCalled = true;
    }
505578
public function preFlush(PreFlushEventArgs $event)
    {
        $entityManager = $event->getEntityManager();
        $uow = $entityManager->getUnitOfWork();

        foreach ($uow->getIdentityMap() as $class => $entities) {
            foreach ($entities as $entity) {
                if ($entity instanceof DeletableInterface) {
                    if ($entity->isDeleted()) {
                        $entityManager->remove($entity);
                    }
                }
            }
        }
    }
917320
public function forget(Event $event)
    {
        $this->cache->store($this->store)->forget($event->mutexName());
    }
981939
public static function onAfterRemove(Event $event)
    {
        $layout = $event->getTarget();
        if (!is_a($layout, 'BackBee\Site\Layout')) {
            return;
        }

        $dispatcher = $event->getDispatcher();
        if (null !== $dispatcher->getApplication()) {
            $dispatcher->getApplication()->getEntityManager()
                    ->getRepository('BackBee\Site\Layout')
                    ->removeThumbnail($layout, $dispatcher->getApplication());
        }

        $dispatcher->getApplication()->getRenderer()->removeLayout($layout);
    }