protected function getDataTablesEntityById(DataTablesProviderInterface $dtProvider, $id) {

        $repository = $this->getDataTablesRepository($dtProvider);

        $this->getLogger()->debug(sprintf("DataTables controller search for an entity [%s]", $id));

        $entity = $repository->find($id);
        if (null === $entity) {
            throw EntityNotFoundException::fromClassNameAndIdentifier($dtProvider->getEntity(), [$id]);
        }

        $this->getLogger()->debug(sprintf("DataTables controller found an entity [%s]", $id));

        return $entity;
    }
protected function getDataTablesEntityById(DataTablesProviderInterface $dtProvider, $id) {

        $repository = $this->getDataTablesRepository($dtProvider);

        $this->getLogger()->debug(sprintf("DataTables controller search for an entity [%s]", $id));

        $entity = $repository->find($id);
        if (null === $entity) {
            throw EntityNotFoundException::fromClassNameAndIdentifier($dtProvider->getEntity(), [$id]);
        }

        $this->getLogger()->debug(sprintf("DataTables controller found an entity [%s]", $id));

        return $entity;
    }
protected function getDataTablesEntityById ( DataTablesProviderInterface $ dtProvider , $ id ) { $ repository = $ this -> getDataTablesRepository ( $ dtProvider ) ; $ this -> getLogger ( ) -> debug ( sprintf ( "DataTables controller search for an entity [%s]" , $ id ) ) ; $ entity = $ repository -> find ( $ id ) ; if ( null === $ entity ) { throw EntityNotFoundException :: fromClassNameAndIdentifier ( $ dtProvider -> getEntity ( ) , [ $ id ] ) ; } $ this -> getLogger ( ) -> debug ( sprintf ( "DataTables controller found an entity [%s]" , $ id ) ) ; return $ entity ; }
Get an entity by id.

@param DataTablesProviderInterface $dtProvider The provider.
@param int $id The entity id.
@return object Returns the entity.
@throws BadDataTablesRepositoryException Throws a bad repository exception.
@throws EntityNotFoundException Throws an Entity not found exception.
Get an entity by id .