I really am at a point where I am out of Ideas. I just want to order categories with Doctrine. After a litle doctrine documentation reading I uses following in my Controller:
$categories = $em->getRepository('\Cbox\Entity\Category')->findBy(array('title' =>'news'), array('createdTime' => 'DESC'));
Both Column's exist nor do I get a PHP/Doctrine/Mysql Error. Is this the right aproach? I also tried using orderBy Annotations in my Entity with no success either:
/**
* @ORM\OneToMany(targetEntity="Cbox\Entity\Category", mappedBy="box")
* @ORM\OrderBy({"createdTime" = "DESC"})
*/
protected $category;
I also did read about the QueryBuilder and the DQL but this just seems to be a litle bit of an overkill to get the orderBy set.
Any help would be much appreciated. I also do hope thats enough code for you guys to get the picture. But I rather have the "problematic" parts shown here then tons of code.