add form to doc generation and custom form to admin template configuration

This commit is contained in:
2021-12-01 23:00:02 +01:00
parent 7719d2b073
commit 475b40e896
15 changed files with 484 additions and 108 deletions

View File

@@ -0,0 +1,79 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
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;
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
*/
public function find($id): ?DocumentCategory
{
return $this->repository->find($id);
}
/**
* @return array|DocumentCategory[]
*/
public function findAll(): array
{
return $this->repository->findAll();
}
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null)
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}
public function findOneBy(array $criteria): ?DocumentCategory
{
return $this->findOneBy($criteria);
}
public function getClassName()
{
return DocumentCategory::class;
}
}