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;
    }