mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-21 04:32:51 +00:00
Add ticket listing and related enhancements
Added a new functionality for listing tickets with the ability for the user to order the list. A method was added to the User class to identify if an object is an instance of User. Similarly, a method was added to the UserGroup class. User.php, UserGroup.php, TicketRepository.php, and TicketRepositoryInterface.php were updated. A new TicketListController, MotiveRepository, and SectionMenuBuilder were created. Translations were included, and services.yaml was updated.
This commit is contained in:
@@ -19,7 +19,7 @@ final readonly class TicketRepository implements TicketRepositoryInterface
|
||||
{
|
||||
private ObjectRepository $repository;
|
||||
|
||||
public function __construct(EntityManagerInterface $objectManager)
|
||||
public function __construct(private EntityManagerInterface $objectManager)
|
||||
{
|
||||
$this->repository = $objectManager->getRepository($this->getClassName());
|
||||
}
|
||||
@@ -34,6 +34,14 @@ final readonly class TicketRepository implements TicketRepositoryInterface
|
||||
return $this->repository->findAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<Ticket>
|
||||
*/
|
||||
public function findAllOrdered(): array
|
||||
{
|
||||
return $this->objectManager->createQuery('SELECT t FROM '.$this->getClassName().' t ORDER BY t.id DESC')->getResult();
|
||||
}
|
||||
|
||||
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
|
||||
{
|
||||
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
|
||||
|
Reference in New Issue
Block a user