generate document with relatorio: config and driver

This commit is contained in:
2021-12-02 18:02:19 +01:00
parent 2245f83631
commit af6efdd0ba
15 changed files with 286 additions and 363 deletions

View File

@@ -15,7 +15,7 @@ use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table("chill_doc.document_category")
* @ORM\Entity()
* @ORM\Entity
*/
class DocumentCategory
{

View File

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