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)));
        }
    }
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)));
        }
    }
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 ) ) ) ; } }
Clears cached data associated to the content to be flushed.

@param \BackBee\Event\Event $event
Clears cached data associated to the content to be flushed .