/** * En cache pour 1h */ public function statsIntentsAction() { $response = new Response(); $response->setPublic(); $response->setSharedMaxAge(3600); $ir = $this->getDoctrine()->getManager()->getRepository('DonateCoreBundle:Intent'); $stats = []; foreach (Intent::getPossibleStatus() as $status) { $stats[$status] = $ir->getCountByStatus($status); } return $this->render('DonateAdminBundle:Dashboard:statsIntents.html.twig', ['id' => 'stats-intents', 'title' => $this->get('translator')->trans('Donations distributions'), 'stats' => $stats], $response); }
public function intentStatus() { return $this->getOne(Intent::getPossibleStatus()); }