diff --git a/Bundle/BlogBundle/Entity/Blog.php b/Bundle/BlogBundle/Entity/Blog.php index 7abac7b0a..d741e4f57 100644 --- a/Bundle/BlogBundle/Entity/Blog.php +++ b/Bundle/BlogBundle/Entity/Blog.php @@ -5,6 +5,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; use Victoire\Bundle\PageBundle\Entity\Page; +use Victoire\Bundle\PageBundle\Entity\PageStatus; /** * PostPage. @@ -74,7 +75,8 @@ public function getArticles() public function getPublishedArticles() { return $this->articles->filter(function (Article $article) { - return $article->getPublishedAt() <= new \DateTime(); + return $article->getStatus() === PageStatus::PUBLISHED + && $article->getPublishedAt() <= new \DateTime(); }); }