public function showAction($name, $id) {

        $dtProvider = $this->getDataTablesProvider($name);

        try {

            $entity = $this->getDataTablesEntityById($dtProvider, $id);

            $this->dispatchDataTablesEvent(DataTablesEvents::DATATABLES_PRE_SHOW, [$entity]);
        } catch (EntityNotFoundException $ex) {

            $this->getLogger()->debug($ex->getMessage());

            $entity = [];
        }

        $serializer = $this->getDataTablesSerializer();

        return new Response($serializer->serialize($entity, "json"), 200, ["Content-type" => "application/json"]);
    }
public function showAction($name, $id) {

        $dtProvider = $this->getDataTablesProvider($name);

        try {

            $entity = $this->getDataTablesEntityById($dtProvider, $id);

            $this->dispatchDataTablesEvent(DataTablesEvents::DATATABLES_PRE_SHOW, [$entity]);
        } catch (EntityNotFoundException $ex) {

            $this->getLogger()->debug($ex->getMessage());

            $entity = [];
        }

        $serializer = $this->getDataTablesSerializer();

        return new Response($serializer->serialize($entity, "json"), 200, ["Content-type" => "application/json"]);
    }
public function showAction ( $ name , $ id ) { $ dtProvider = $ this -> getDataTablesProvider ( $ name ) ; try { $ entity = $ this -> getDataTablesEntityById ( $ dtProvider , $ id ) ; $ this -> dispatchDataTablesEvent ( DataTablesEvents :: DATATABLES_PRE_SHOW , [ $ entity ] ) ; } catch ( EntityNotFoundException $ ex ) { $ this -> getLogger ( ) -> debug ( $ ex -> getMessage ( ) ) ; $ entity = [ ] ; } $ serializer = $ this -> getDataTablesSerializer ( ) ; return new Response ( $ serializer -> serialize ( $ entity , "json" ) , 200 , [ "Content-type" => "application/json" ] ) ; }
Show an existing entity.

@param string $name The provider name.
@param string $id The entity id.
@return Response Returns the response.
@throws BadDataTablesRepositoryException Throws a bad repository exception.
@throws UnregisteredDataTablesProviderException Throws an unregistered provider exception.
Show an existing entity .