WIP: Implementation of stuff goes on
This commit is contained in:
@@ -52,6 +52,8 @@ class UserDataHandler
|
||||
{
|
||||
$user = new User();
|
||||
$user
|
||||
->setFirstName($profileResponse->getFirstName())
|
||||
->setLastName($profileResponse->getName())
|
||||
->setEmail($profileResponse->getCommunication()->getEmail())
|
||||
->setBusProPersonId($profileResponse->getPersonId())
|
||||
->setBusProAddressId($profileResponse->getAddressId())
|
||||
|
||||
@@ -4,14 +4,24 @@ namespace App\Controller\Admin\Assignment;
|
||||
|
||||
use App\Entity\Assignment;
|
||||
use App\Form\AssignmentType;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
class CreateController extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private readonly LoggerInterface $logger
|
||||
) {
|
||||
}
|
||||
|
||||
#[Route('/admin/assignment/create', name: 'app_admin_assignment_create')]
|
||||
#[IsGranted('ROLE_ADMINISTRATIVE')]
|
||||
public function index(Request $request): Response
|
||||
{
|
||||
$assignment = new Assignment();
|
||||
@@ -19,6 +29,15 @@ class CreateController extends AbstractController
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$this->entityManager->persist($assignment);
|
||||
$this->entityManager->flush();
|
||||
|
||||
$this->addFlash('success', 'Der Einsatz wurde angelegt');
|
||||
|
||||
$this->logger->info('Create assignment', [
|
||||
'assignment' => $assignment->getUuid(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_assignment_index');
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller\Admin\Assignment;
|
||||
|
||||
use App\Entity\Assignment;
|
||||
use App\Form\AssignmentType;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
class EditController extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private readonly LoggerInterface $logger
|
||||
) {
|
||||
}
|
||||
|
||||
#[Route('/admin/assignment/edit/{uuid}', name: 'app_admin_assignment_edit')]
|
||||
#[IsGranted('ROLE_ADMINISTRATIVE')]
|
||||
public function index(Assignment $assignment, Request $request): Response
|
||||
{
|
||||
$form = $this->createForm(AssignmentType::class, $assignment);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$this->entityManager->flush();
|
||||
|
||||
$this->addFlash('success', 'Der Einsatz wurde aktualisiert');
|
||||
|
||||
$this->logger->info('Edit assignment', [
|
||||
'assignment' => $assignment->getUuid(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_assignment_index');
|
||||
}
|
||||
|
||||
return $this->render('admin/assignment/edit.html.twig', [
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -2,15 +2,43 @@
|
||||
|
||||
namespace App\Controller\Admin\Assignment;
|
||||
|
||||
use App\Repository\AssignmentRepository;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
class IndexController extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
private readonly AssignmentRepository $assignmentRepository,
|
||||
private readonly PaginatorInterface $paginator
|
||||
) {
|
||||
}
|
||||
|
||||
#[Route('/admin/assignment', name: 'app_admin_assignment_index')]
|
||||
public function index(): Response
|
||||
#[IsGranted('ROLE_ADMINISTRATIVE')]
|
||||
public function index(Request $request): Response
|
||||
{
|
||||
return $this->render('admin/assignment/index.html.twig');
|
||||
$query = $this
|
||||
->assignmentRepository
|
||||
->getListQuery()
|
||||
;
|
||||
|
||||
$pagination = $this->paginator->paginate(
|
||||
$query,
|
||||
$request->query->getInt('page', 1),
|
||||
10,
|
||||
[
|
||||
'defaultSortFieldName' => 'assignment.dateFrom',
|
||||
'defaultSortDirection' => 'asc',
|
||||
]
|
||||
);
|
||||
|
||||
return $this->render('admin/assignment/index.html.twig', [
|
||||
'pagination' => $pagination,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@ class HotelController extends AbstractController
|
||||
$name = $hotel->getName();
|
||||
if (1 === preg_match('/'.preg_quote($queryString, '/').'/i', $name)) {
|
||||
$data[] = [
|
||||
'value' => $hotel->getId(),
|
||||
'value' => $hotel->getBusProId(),
|
||||
'text' => sprintf('%s (%s)', $name, $hotel->getCode()),
|
||||
];
|
||||
}
|
||||
|
||||
+26
-49
@@ -4,12 +4,14 @@ namespace App\Entity;
|
||||
|
||||
use App\Entity\Traits\BlameableEntity;
|
||||
use App\Entity\Traits\TimestampableEntity;
|
||||
use App\Model\BenefitsDto;
|
||||
use App\Repository\AssignmentRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
#[ORM\Entity(repositoryClass: AssignmentRepository::class)]
|
||||
class Assignment implements BlameableEntityInterface, TimestampableEntityInterface
|
||||
@@ -26,36 +28,41 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
|
||||
private string $uuid;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
#[Assert\NotNull(message: 'Bitte gib die Destination an')]
|
||||
private ?int $destinationBusProId = null;
|
||||
|
||||
#[ORM\ManyToOne]
|
||||
#[Assert\NotNull(message: 'Bitte gib das Jobprofil an')]
|
||||
private ?JobProfile $jobProfile = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $available = null;
|
||||
#[Assert\Range(min: 1, minMessage: 'Die Mindestanzahl ist 1')]
|
||||
private ?int $available = 1;
|
||||
|
||||
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
|
||||
#[Assert\NotNull(message: 'Bitte gib das Beginndatum an')]
|
||||
private ?\DateTimeImmutable $dateFrom = null;
|
||||
|
||||
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
|
||||
#[Assert\NotNull(message: 'Bitte gib das Enddatum an')]
|
||||
#[Assert\GreaterThan(propertyPath: 'dateFrom', message: 'Das Enddatum muss nach dem Beginndatum liegen')]
|
||||
private ?\DateTimeImmutable $dateTo = null;
|
||||
|
||||
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
|
||||
#[Assert\GreaterThanOrEqual(propertyPath: 'dateFrom', message: 'Die Busabfahrt muss am oder nach dem Beginndatum liegen')]
|
||||
private ?\DateTimeImmutable $pickupDate = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $pickup = null;
|
||||
|
||||
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
||||
private ?string $benefits = null;
|
||||
#[ORM\Column]
|
||||
private array $benefits;
|
||||
|
||||
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
||||
private ?string $remarks = null;
|
||||
|
||||
#[ORM\ManyToOne]
|
||||
private ?User $owner = null;
|
||||
|
||||
#[ORM\ManyToMany(targetEntity: Fee::class)]
|
||||
#[Assert\Count(min: 1, minMessage: 'Bitte triff mindestens eine Auswahl')]
|
||||
private Collection $fees;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'assignment', targetEntity: Application::class)]
|
||||
@@ -64,8 +71,8 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
|
||||
#[ORM\OneToMany(mappedBy: 'assignment', targetEntity: Disposition::class)]
|
||||
private Collection $dispositions;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'assignment', targetEntity: DispositionRequirement::class)]
|
||||
private Collection $requirements;
|
||||
#[ORM\ManyToOne]
|
||||
private ?User $contact = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -73,7 +80,7 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
|
||||
$this->fees = new ArrayCollection();
|
||||
$this->applications = new ArrayCollection();
|
||||
$this->dispositions = new ArrayCollection();
|
||||
$this->requirements = new ArrayCollection();
|
||||
$this->benefits = BenefitsDto::$defaults;
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
@@ -127,7 +134,7 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
|
||||
return $this->dateFrom;
|
||||
}
|
||||
|
||||
public function setDateFrom(\DateTimeImmutable $dateFrom): static
|
||||
public function setDateFrom(?\DateTimeImmutable $dateFrom): static
|
||||
{
|
||||
$this->dateFrom = $dateFrom;
|
||||
|
||||
@@ -139,7 +146,7 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
|
||||
return $this->dateTo;
|
||||
}
|
||||
|
||||
public function setDateTo(\DateTimeImmutable $dateTo): static
|
||||
public function setDateTo(?\DateTimeImmutable $dateTo): static
|
||||
{
|
||||
$this->dateTo = $dateTo;
|
||||
|
||||
@@ -163,19 +170,19 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
|
||||
return $this->pickup;
|
||||
}
|
||||
|
||||
public function setPickup(?int $pickup): static
|
||||
public function setPickup(null|int|string $pickup): static
|
||||
{
|
||||
$this->pickup = $pickup;
|
||||
$this->pickup = (int) $pickup;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBenefits(): ?string
|
||||
public function getBenefits(): array
|
||||
{
|
||||
return $this->benefits;
|
||||
}
|
||||
|
||||
public function setBenefits(string $benefits): static
|
||||
public function setBenefits(array $benefits): static
|
||||
{
|
||||
$this->benefits = $benefits;
|
||||
|
||||
@@ -194,18 +201,6 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOwner(): ?User
|
||||
{
|
||||
return $this->owner;
|
||||
}
|
||||
|
||||
public function setOwner(?User $owner): static
|
||||
{
|
||||
$this->owner = $owner;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Fee>
|
||||
*/
|
||||
@@ -290,32 +285,14 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, DispositionRequirement>
|
||||
*/
|
||||
public function getRequirements(): Collection
|
||||
public function getContact(): ?User
|
||||
{
|
||||
return $this->requirements;
|
||||
return $this->contact;
|
||||
}
|
||||
|
||||
public function addRequirement(DispositionRequirement $requirement): static
|
||||
public function setContact(?User $contact): static
|
||||
{
|
||||
if (!$this->requirements->contains($requirement)) {
|
||||
$this->requirements->add($requirement);
|
||||
$requirement->setAssignment($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeRequirement(DispositionRequirement $requirement): static
|
||||
{
|
||||
if ($this->requirements->removeElement($requirement)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($requirement->getAssignment() === $this) {
|
||||
$requirement->setAssignment(null);
|
||||
}
|
||||
}
|
||||
$this->contact = $contact;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,12 @@ class User implements UserInterface, TimestampableEntityInterface
|
||||
#[ORM\Column]
|
||||
private ?int $busProPersonId = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $firstName = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $lastName = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $email = null;
|
||||
|
||||
@@ -44,6 +50,11 @@ class User implements UserInterface, TimestampableEntityInterface
|
||||
$this->uuid = Uuid::v4();
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return $this->getFullName();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
@@ -78,6 +89,39 @@ class User implements UserInterface, TimestampableEntityInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFirstName(): ?string
|
||||
{
|
||||
return $this->firstName;
|
||||
}
|
||||
|
||||
public function setFirstName(?string $firstName): static
|
||||
{
|
||||
$this->firstName = $firstName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLastName(): ?string
|
||||
{
|
||||
return $this->lastName;
|
||||
}
|
||||
|
||||
public function setLastName(?string $lastName): static
|
||||
{
|
||||
$this->lastName = $lastName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFullName(bool $formal = false): string
|
||||
{
|
||||
if (true === $formal) {
|
||||
return sprintf('%s, %s', $this->getLastName(), $this->getFirstName());
|
||||
}
|
||||
|
||||
return sprintf('%s %s', $this->getFirstName(), $this->getLastName());
|
||||
}
|
||||
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
return $this->email;
|
||||
|
||||
@@ -5,8 +5,12 @@ namespace App\Form;
|
||||
use App\Entity\Assignment;
|
||||
use App\Entity\Fee;
|
||||
use App\Entity\JobProfile;
|
||||
use App\Entity\User;
|
||||
use App\Model\BenefitsDto;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
@@ -33,7 +37,6 @@ class AssignmentType extends AbstractType
|
||||
])
|
||||
->add('dateFrom', DatepickerType::class, [
|
||||
'label' => 'Einsatztermin von',
|
||||
'mode' => 'range',
|
||||
])
|
||||
->add('dateTo', DatepickerType::class, [
|
||||
'label' => 'Einsatztermin bis',
|
||||
@@ -47,9 +50,12 @@ class AssignmentType extends AbstractType
|
||||
'required' => false,
|
||||
'placeholder' => 'Keine Busbegleitung',
|
||||
])
|
||||
->add('benefits', TextareaType::class, [
|
||||
->add('benefits', ChoiceType::class, [
|
||||
'label' => 'Benefits',
|
||||
'required' => false,
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
'choices' => array_flip(BenefitsDto::$values),
|
||||
])
|
||||
->add('fees', EntityType::class, [
|
||||
'label' => 'Honorar(e)',
|
||||
@@ -58,6 +64,27 @@ class AssignmentType extends AbstractType
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
])
|
||||
->add('contact', EntityType::class, [
|
||||
'label' => 'Ansprechpartner RM',
|
||||
'class' => User::class,
|
||||
'choice_label' => 'fullName',
|
||||
'query_builder' => function (EntityRepository $repository) {
|
||||
$qb = $repository->createQueryBuilder('user');
|
||||
|
||||
return $qb
|
||||
->where($qb->expr()->like('user.roles', ':role'))
|
||||
->setParameter('role','%ROLE_MANAGER%')
|
||||
->orderBy('user.firstName', 'ASC')
|
||||
;
|
||||
},
|
||||
])
|
||||
->add('remarks', TextareaType::class, [
|
||||
'label' => 'Anmerkungen',
|
||||
'required' => false,
|
||||
'attr' => [
|
||||
'rows' => 3,
|
||||
],
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,13 +19,10 @@ class DatepickerType extends AbstractType
|
||||
'min_date' => null,
|
||||
'max_date' => null,
|
||||
'disable_weekends' => false,
|
||||
'mode' => 'single', // 'single', 'multiple' or 'range'
|
||||
]);
|
||||
$resolver->setAllowedTypes('min_date', ['null', \DateTimeImmutable::class]);
|
||||
$resolver->setAllowedTypes('max_date', ['null', \DateTimeImmutable::class]);
|
||||
$resolver->setAllowedTypes('disable_weekends', 'bool');
|
||||
$resolver->setAllowedTypes('mode', 'string');
|
||||
$resolver->setAllowedValues('mode', ['single', 'multiple', 'range']);
|
||||
}
|
||||
|
||||
public function buildView(FormView $view, FormInterface $form, array $options): void
|
||||
@@ -33,7 +30,6 @@ class DatepickerType extends AbstractType
|
||||
$view->vars['min_date'] = $options['min_date'];
|
||||
$view->vars['max_date'] = $options['max_date'];
|
||||
$view->vars['disable_weekends'] = $options['disable_weekends'];
|
||||
$view->vars['mode'] = $options['mode'];
|
||||
}
|
||||
|
||||
public function getParent(): string
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
class BenefitsDto
|
||||
{
|
||||
public static array $defaults = [
|
||||
'anreise',
|
||||
'unterkunft',
|
||||
'verpflegung',
|
||||
'skipass',
|
||||
];
|
||||
|
||||
public static array $values = [
|
||||
'anreise' => 'Anreise im E&P Reisebus',
|
||||
'unterkunft' => 'Unterkunft',
|
||||
'verpflegung' => 'Verpflegung',
|
||||
'skipass' => 'Skipass',
|
||||
];
|
||||
}
|
||||
@@ -4,6 +4,7 @@ namespace App\Repository;
|
||||
|
||||
use App\Entity\Assignment;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
@@ -21,46 +22,11 @@ class AssignmentRepository extends ServiceEntityRepository
|
||||
parent::__construct($registry, Assignment::class);
|
||||
}
|
||||
|
||||
public function save(Assignment $entity, bool $flush = false): void
|
||||
public function getListQuery(): Query
|
||||
{
|
||||
$this->getEntityManager()->persist($entity);
|
||||
|
||||
if ($flush) {
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
return $this
|
||||
->createQueryBuilder('assignment')
|
||||
->getQuery()
|
||||
;
|
||||
}
|
||||
|
||||
public function remove(Assignment $entity, bool $flush = false): void
|
||||
{
|
||||
$this->getEntityManager()->remove($entity);
|
||||
|
||||
if ($flush) {
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Assignment[] Returns an array of Assignment objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('a')
|
||||
// ->andWhere('a.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('a.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Assignment
|
||||
// {
|
||||
// return $this->createQueryBuilder('a')
|
||||
// ->andWhere('a.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ class AppExtension extends AbstractExtension
|
||||
new TwigFilter('teamer_status_label', [AppRuntime::class, 'teamerStatusLabel']),
|
||||
new TwigFilter('bpn_country_label', [AppRuntime::class, 'bpnCountryLabel']),
|
||||
new TwigFilter('bpn_pickup_label', [AppRuntime::class, 'bpnPickupLabel']),
|
||||
new TwigFilter('bpn_destination_label', [AppRuntime::class, 'bpnDestinationLabel']),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Twig;
|
||||
|
||||
use App\BusProNet\DataProvider\CountryDataProvider;
|
||||
use App\BusProNet\DataProvider\HotelDataProvider;
|
||||
use App\BusProNet\DataProvider\PickupDataProvider;
|
||||
use App\BusProNet\Model\Country;
|
||||
use App\Entity\Teamer;
|
||||
@@ -19,6 +20,7 @@ class AppRuntime implements RuntimeExtensionInterface
|
||||
private readonly IntlExtension $intlExtension,
|
||||
private readonly CountryDataProvider $countries,
|
||||
private readonly PickupDataProvider $pickups,
|
||||
private readonly HotelDataProvider $hotels,
|
||||
private readonly string $environment
|
||||
) {
|
||||
}
|
||||
@@ -59,6 +61,17 @@ class AppRuntime implements RuntimeExtensionInterface
|
||||
return $pickup->getCity();
|
||||
}
|
||||
|
||||
public function bpnDestinationLabel(int $id): string
|
||||
{
|
||||
$hotel = $this->hotels->get($id);
|
||||
|
||||
if (null === $hotel) {
|
||||
return 'unbekannt';
|
||||
}
|
||||
|
||||
return sprintf('%s, %s', $hotel->getName(), $hotel->getCity() ?? '-');
|
||||
}
|
||||
|
||||
public function fileIconFilter(Environment $environment, string $mimeType, ?string $classes = 'w-4 h-4'): string
|
||||
{
|
||||
$icon = match ($mimeType) {
|
||||
|
||||
Reference in New Issue
Block a user