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

        $stringHelper = $this->container->get('opifer.content.string_helper');
        $contents = $this->get('jms_serializer')->serialize($items, 'json', SerializationContext::create()->setGroups(['list'])->enableMaxDepthChecks());
        $contents = $stringHelper->replaceLinks($contents);

        $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()
            ->findOrderedByIds($ids);

        $stringHelper = $this->container->get('opifer.content.string_helper');
        $contents = $this->get('jms_serializer')->serialize($items, 'json', SerializationContext::create()->setGroups(['list'])->enableMaxDepthChecks());
        $contents = $stringHelper->replaceLinks($contents);

        $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 ( ) -> findOrderedByIds ( $ ids ) ; $ stringHelper = $ this -> container -> get ( 'opifer.content.string_helper' ) ; $ contents = $ this -> get ( 'jms_serializer' ) -> serialize ( $ items , 'json' , SerializationContext :: create ( ) -> setGroups ( [ 'list' ] ) -> enableMaxDepthChecks ( ) ) ; $ contents = $ stringHelper -> replaceLinks ( $ contents ) ; $ 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 .