public function idsAction($ids)
    {
        $items = $this->get('opifer.content.content_manager')
            ->getRepository()
            ->findByIds($ids);

        $contents = $this->get('jms_serializer')->serialize($items, 'json', SerializationContext::create()->setGroups(['list'])->enableMaxDepthChecks());

        $data = [
            'results'       => json_decode($contents, true),
            'total_results' => count($items)
        ];

        return new JsonResponse($data);
    }
public function idsAction($ids)
    {
        $items = $this->get('opifer.content.content_manager')
            ->getRepository()
            ->findByIds($ids);

        $contents = $this->get('jms_serializer')->serialize($items, 'json', SerializationContext::create()->setGroups(['list'])->enableMaxDepthChecks());

        $data = [
            'results'       => json_decode($contents, true),
            'total_results' => count($items)
        ];

        return new JsonResponse($data);
    }
public function idsAction ( $ ids ) { $ items = $ this -> get ( 'opifer.content.content_manager' ) -> getRepository ( ) -> findByIds ( $ ids ) ; $ contents = $ this -> get ( 'jms_serializer' ) -> serialize ( $ items , 'json' , SerializationContext :: create ( ) -> setGroups ( [ 'list' ] ) -> enableMaxDepthChecks ( ) ) ; $ data = [ 'results' => json_decode ( $ contents , true ) , 'total_results' => count ( $ items ) ] ; return new JsonResponse ( $ data ) ; }
Get a content items by a list of ids

@param string $ids

@return JsonResponse
Get a content items by a list of ids