app['EM']->getRepository('Entities\Basket'); $sort = in_array($sort, array('date', 'name')) ? $sort : 'name'; $ret = new \Doctrine\Common\Collections\ArrayCollection(); $baskets = $repo_baskets->findActiveByUser($this->app['authentication']->getUser(), $sort); $validations = $repo_baskets->findActiveValidationByUser($this->app['authentication']->getUser(), $sort); /* @var $repo_stories \Doctrine\Repositories\StoryWZRepository */ $repo_stories = $this->app['EM']->getRepository('Entities\StoryWZ'); $stories = $repo_stories->findByUser($this->app, $this->app['authentication']->getUser(), $sort); $ret->set(self::BASKETS, $baskets); $ret->set(self::VALIDATIONS, $validations); $ret->set(self::STORIES, $stories); return $ret; } protected function sortBaskets(array $baskets) { $tmp_baskets = array(); } }