original_string: public function statsAction($id, $from, $to)
      {
          $em = $this->getDoctrine()->getManager();
  
          /** @var Actor $entity */
          $entity = $em->getRepository('EcommerceBundle:Product')->find($id);
          
          /** @var FrontManager $frontManager */
          $adminManager =  $this->container->get('admin_manager');
          $stats = $adminManager->getProductStats($entity, $from, $to);
  
          $label = array();
          $visits = array();
          foreach ($stats as  $stat) {
              $label[] = $stat['day'];
              $visits[] = $stat['visits'];
          }
          
          $returnValues = new \stdClass();
          $returnValues->count = count($stats);
          $returnValues->labels = implode(',', $label);
          $returnValues->visits = implode(',', $visits);
  
          return new JsonResponse($returnValues);
      }
code: public function statsAction($id, $from, $to)
      {
          $em = $this->getDoctrine()->getManager();
  
          /** @var Actor $entity */
          $entity = $em->getRepository('EcommerceBundle:Product')->find($id);
          
          /** @var FrontManager $frontManager */
          $adminManager =  $this->container->get('admin_manager');
          $stats = $adminManager->getProductStats($entity, $from, $to);
  
          $label = array();
          $visits = array();
          foreach ($stats as  $stat) {
              $label[] = $stat['day'];
              $visits[] = $stat['visits'];
          }
          
          $returnValues = new \stdClass();
          $returnValues->count = count($stats);
          $returnValues->labels = implode(',', $label);
          $returnValues->visits = implode(',', $visits);
  
          return new JsonResponse($returnValues);
      }
code_tokens: public function statsAction ( $ id , $ from , $ to ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; /** @var Actor $entity */ $ entity = $ em -> getRepository ( 'EcommerceBundle:Product' ) -> find ( $ id ) ; /** @var FrontManager $frontManager */ $ adminManager = $ this -> container -> get ( 'admin_manager' ) ; $ stats = $ adminManager -> getProductStats ( $ entity , $ from , $ to ) ; $ label = array ( ) ; $ visits = array ( ) ; foreach ( $ stats as $ stat ) { $ label [ ] = $ stat [ 'day' ] ; $ visits [ ] = $ stat [ 'visits' ] ; } $ returnValues = new \ stdClass ( ) ; $ returnValues -> count = count ( $ stats ) ; $ returnValues -> labels = implode ( ',' , $ label ) ; $ returnValues -> visits = implode ( ',' , $ visits ) ; return new JsonResponse ( $ returnValues ) ; }
docstring: Returns a list of Actor entities in JSON format.
  
  @return JsonResponse
  
  @Route("/stats/{id}/{from}/{to}", requirements={ "_format" = "json" }, defaults={ "_format" = "json" })
  @Method("GET")
docstring_tokens: Returns a list of Actor entities in JSON format .