Bundle/BlogBundle/Manager/ArticleManager.php
public function delete(Article $article)
    {
        $bep = $this->pageHelper->findPageByParameters(
            [
                'templateId' => $article->getTemplate()->getId(),
                'entityId'   => $article->getId(),
            ]
        );
        $this->entityManager->remove($bep);

        $article->setVisibleOnFront(0);
        $article->setDeletedAt(new \DateTime());
        $article->setStatus(PageStatus::DELETED);

        $this->entityManager->flush();
    }
public function delete(Article $article)
    {
        $bep = $this->pageHelper->findPageByParameters(
            [
                'templateId' => $article->getTemplate()->getId(),
                'entityId'   => $article->getId(),
            ]
        );
        $this->entityManager->remove($bep);

        $article->setVisibleOnFront(0);
        $article->setDeletedAt(new \DateTime());
        $article->setStatus(PageStatus::DELETED);

        $this->entityManager->flush();
    }
public function delete ( Article $ article ) { $ bep = $ this -> pageHelper -> findPageByParameters ( [ 'templateId' => $ article -> getTemplate ( ) -> getId ( ) , 'entityId' => $ article -> getId ( ) , ] ) ; $ this -> entityManager -> remove ( $ bep ) ; $ article -> setVisibleOnFront ( 0 ) ; $ article -> setDeletedAt ( new \ DateTime ( ) ) ; $ article -> setStatus ( PageStatus :: DELETED ) ; $ this -> entityManager -> flush ( ) ; }
Delete a given Article.

@param Article $article
Delete a given Article .