Fixed non-public news display issue
Non-public news items didn't appear at all.
This commit is contained in:
parent
acc64ee66d
commit
ff1e3fd9fc
@ -21,7 +21,7 @@ class NewsExtension extends \Twig_Extension
|
|||||||
{
|
{
|
||||||
$newsRepo = $this->_doctrine->getRepository('KekRozsakFrontBundle:News');
|
$newsRepo = $this->_doctrine->getRepository('KekRozsakFrontBundle:News');
|
||||||
$searchCriteria = array();
|
$searchCriteria = array();
|
||||||
if (!$this->_securityContext->getToken() instanceof Symfony\Component\Security\Core\Authentication\Token\AnonymousToken)
|
if (!is_object($this->_securityContext->getToken()->getUser()))
|
||||||
$searchCriteria['public'] = true;
|
$searchCriteria['public'] = true;
|
||||||
|
|
||||||
$news = $newsRepo->findBy($searchCriteria, array('createdAt' => 'DESC'), 4);
|
$news = $newsRepo->findBy($searchCriteria, array('createdAt' => 'DESC'), 4);
|
||||||
|
Loading…
Reference in New Issue
Block a user