The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ
blueroses.hu project repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB

<?php
namespace KekRozsak\FrontBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
/**
* Description of NewsController
*
* @author polesz
*
* @Route("/hirek")
*/
class NewsController extends Controller
{
/**
* @return array
*
* @Route("/oldalso-lista.html", name="KekRozsakFrontBundle_newsSideList", options={"expose": true})
* @Template()
*/
public function sideListAction()
{
$newsRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:News');
$searchCriteria = array();
if (
!is_object($this->get('security.context')->getToken())
|| !is_object($this->get('security.context')->getToken()->getUser())
) {
$searchCriteria['public'] = true;
}
$news = $newsRepo->findBy($searchCriteria, array('sticky' => 'DESC', 'createdAt' => 'DESC'), 4);
return array(
'recentNews' => $news,
);
}
}