Bundle/BlogBundle/Manager/ArticleManager.php
public function updateSettings(Article $article)
    {
        //Update Tags
        /** @var Tag[] $tags */
        $tags = $article->getTags();
        if (is_array($tags)) {
            foreach ($tags as $tag) {
                $tag->setBlog($article->getBlog());
                $this->entityManager->persist($tag);
            }
        }

        //Update BusinessPage
        $businessPage = $this->pageHelper->findPageByParameters([
            'viewId'   => $article->getTemplate()->getId(),
            'entityId' => $article->getId(),
        ]);
        $template = $article->getTemplate();
        $businessPage->setTemplate($template);

        //Update Page
        $page = $this->pageHelper->findPageByParameters([
            'viewId'   => $template->getId(),
            'entityId' => $article->getId(),
        ]);
        $page->setName($article->getName());
        $page->setSlug($article->getSlug());
        $page->setStatus($article->getStatus());

        $this->entityManager->flush();

        //Set ViewReference for Page redirection
        $viewReference = $this->viewReferenceRepo->getOneReferenceByParameters(
            ['viewId' => $page->getId()]
        );
        $page->setReference($viewReference);

        return $page;
    }
public function updateSettings(Article $article)
    {
        //Update Tags
        /** @var Tag[] $tags */
        $tags = $article->getTags();
        if (is_array($tags)) {
            foreach ($tags as $tag) {
                $tag->setBlog($article->getBlog());
                $this->entityManager->persist($tag);
            }
        }

        //Update BusinessPage
        $businessPage = $this->pageHelper->findPageByParameters([
            'viewId'   => $article->getTemplate()->getId(),
            'entityId' => $article->getId(),
        ]);
        $template = $article->getTemplate();
        $businessPage->setTemplate($template);

        //Update Page
        $page = $this->pageHelper->findPageByParameters([
            'viewId'   => $template->getId(),
            'entityId' => $article->getId(),
        ]);
        $page->setName($article->getName());
        $page->setSlug($article->getSlug());
        $page->setStatus($article->getStatus());

        $this->entityManager->flush();

        //Set ViewReference for Page redirection
        $viewReference = $this->viewReferenceRepo->getOneReferenceByParameters(
            ['viewId' => $page->getId()]
        );
        $page->setReference($viewReference);

        return $page;
    }
public function updateSettings ( Article $ article ) { //Update Tags /** @var Tag[] $tags */ $ tags = $ article -> getTags ( ) ; if ( is_array ( $ tags ) ) { foreach ( $ tags as $ tag ) { $ tag -> setBlog ( $ article -> getBlog ( ) ) ; $ this -> entityManager -> persist ( $ tag ) ; } } //Update BusinessPage $ businessPage = $ this -> pageHelper -> findPageByParameters ( [ 'viewId' => $ article -> getTemplate ( ) -> getId ( ) , 'entityId' => $ article -> getId ( ) , ] ) ; $ template = $ article -> getTemplate ( ) ; $ businessPage -> setTemplate ( $ template ) ; //Update Page $ page = $ this -> pageHelper -> findPageByParameters ( [ 'viewId' => $ template -> getId ( ) , 'entityId' => $ article -> getId ( ) , ] ) ; $ page -> setName ( $ article -> getName ( ) ) ; $ page -> setSlug ( $ article -> getSlug ( ) ) ; $ page -> setStatus ( $ article -> getStatus ( ) ) ; $ this -> entityManager -> flush ( ) ; //Set ViewReference for Page redirection $ viewReference = $ this -> viewReferenceRepo -> getOneReferenceByParameters ( [ 'viewId' => $ page -> getId ( ) ] ) ; $ page -> setReference ( $ viewReference ) ; return $ page ; }
Update Blog Article settings.

@param Article $article

@throws ViewReferenceNotFoundException

@return View
Update Blog Article settings .