/** * Delete a given article. * * @param Article $article */ public function delete(Article $article, BusinessPage $bep) { $this->entityManager->remove($bep); $article->setVisibleOnFront(0); $article->setDeletedAt(new \DateTime()); $article->setStatus(PageStatus::DELETED); //flush the modifications $this->entityManager->flush(); }