mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 15:43:51 +00:00
generate document with relatorio: config and driver
This commit is contained in:
@@ -15,7 +15,7 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Table("chill_doc.document_category")
|
||||
* @ORM\Entity()
|
||||
* @ORM\Entity
|
||||
*/
|
||||
class DocumentCategory
|
||||
{
|
||||
|
@@ -14,38 +14,25 @@ namespace Chill\DocStoreBundle\Repository;
|
||||
use Chill\DocStoreBundle\Entity\DocumentCategory;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\ORM\Mapping\Entity;
|
||||
use Doctrine\Persistence\ObjectRepository;
|
||||
use UnexpectedValueException;
|
||||
|
||||
/**
|
||||
* Get an available idInsideBUndle.
|
||||
*/
|
||||
class DocumentCategoryRepository implements ObjectRepository
|
||||
{
|
||||
private EntityRepository $repository;
|
||||
|
||||
private EntityManagerInterface $em;
|
||||
|
||||
private EntityRepository $repository;
|
||||
|
||||
public function __construct(EntityManagerInterface $em)
|
||||
{
|
||||
$this->em = $em;
|
||||
$this->repository = $em->getRepository(DocumentCategory::class);
|
||||
}
|
||||
|
||||
public function nextIdInsideBundle()
|
||||
{
|
||||
$array_res = $this->em
|
||||
->createQuery(
|
||||
'SELECT MAX(c.idInsideBundle) + 1 FROM ChillDocStoreBundle:DocumentCategory c'
|
||||
)
|
||||
->getSingleResult();
|
||||
|
||||
return reset($array_res);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DocumentCategory|null
|
||||
* @param mixed $id
|
||||
*/
|
||||
public function find($id): ?DocumentCategory
|
||||
{
|
||||
@@ -75,5 +62,14 @@ class DocumentCategoryRepository implements ObjectRepository
|
||||
return DocumentCategory::class;
|
||||
}
|
||||
|
||||
public function nextIdInsideBundle()
|
||||
{
|
||||
$array_res = $this->em
|
||||
->createQuery(
|
||||
'SELECT MAX(c.idInsideBundle) + 1 FROM ChillDocStoreBundle:DocumentCategory c'
|
||||
)
|
||||
->getSingleResult();
|
||||
|
||||
return reset($array_res);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user