public function onBeforeDeletePageCommit(BeforeDeletePageCommitEvent $event)
    {
        if ($event->isAborted()) {
            return;
        }

        $pageManager = $event->getContentManager();
        $pageRepository = $pageManager->getPageRepository();

        try {
            $languages = $this->languageRepository->activeLanguages();
            if (count($languages) > 0) {
                $result = null;
                $pageRepository->startTransaction();
                $idPage = $pageManager->get()->getId();
                foreach ($languages as $alLanguage) {
                    $result = $this->seoManager->deleteSeoAttributesFromLanguage($alLanguage->getId(), $idPage);
                    if (false === $result) break;
                }

                if (false !== $result) {
                    $pageRepository->commit();
                } else {
                    $pageRepository->rollBack();

                    $event->abort();
                }
            }
        } catch (\Exception $e) {
            $event->abort();
            if (isset($pageRepository) && $pageRepository !== null) {
                $pageRepository->rollBack();
            }

            throw $e;
        }
    }
public function onBeforeDeletePageCommit(BeforeDeletePageCommitEvent $event)
    {
        if ($event->isAborted()) {
            return;
        }

        $pageManager = $event->getContentManager();
        $pageRepository = $pageManager->getPageRepository();

        try {
            $languages = $this->languageRepository->activeLanguages();
            if (count($languages) > 0) {
                $result = null;
                $pageRepository->startTransaction();
                $idPage = $pageManager->get()->getId();
                foreach ($languages as $alLanguage) {
                    $result = $this->seoManager->deleteSeoAttributesFromLanguage($alLanguage->getId(), $idPage);
                    if (false === $result) break;
                }

                if (false !== $result) {
                    $pageRepository->commit();
                } else {
                    $pageRepository->rollBack();

                    $event->abort();
                }
            }
        } catch (\Exception $e) {
            $event->abort();
            if (isset($pageRepository) && $pageRepository !== null) {
                $pageRepository->rollBack();
            }

            throw $e;
        }
    }
public function onBeforeDeletePageCommit ( BeforeDeletePageCommitEvent $ event ) { if ( $ event -> isAborted ( ) ) { return ; } $ pageManager = $ event -> getContentManager ( ) ; $ pageRepository = $ pageManager -> getPageRepository ( ) ; try { $ languages = $ this -> languageRepository -> activeLanguages ( ) ; if ( count ( $ languages ) > 0 ) { $ result = null ; $ pageRepository -> startTransaction ( ) ; $ idPage = $ pageManager -> get ( ) -> getId ( ) ; foreach ( $ languages as $ alLanguage ) { $ result = $ this -> seoManager -> deleteSeoAttributesFromLanguage ( $ alLanguage -> getId ( ) , $ idPage ) ; if ( false === $ result ) break ; } if ( false !== $ result ) { $ pageRepository -> commit ( ) ; } else { $ pageRepository -> rollBack ( ) ; $ event -> abort ( ) ; } } } catch ( \ Exception $ e ) { $ event -> abort ( ) ; if ( isset ( $ pageRepository ) && $ pageRepository !== null ) { $ pageRepository -> rollBack ( ) ; } throw $ e ; } }
Deletes the page's seo attributes, for all the languages of the site

@param  BeforeDeletePageCommitEvent $event
@return boolean
@throws \Exception

api
Deletes the page s seo attributes for all the languages of the site