Bläddra i källkod

TicketSolver : gestion context getTypeChoices()

develop
Guillaume 2 år sedan
förälder
incheckning
3987761815
2 ändrade filer med 5 tillägg och 3 borttagningar
  1. +4
    -2
      Form/Ticket/TicketFormType.php
  2. +1
    -1
      Solver/Ticket/TicketSolver.php

+ 4
- 2
Form/Ticket/TicketFormType.php Visa fil

@@ -32,6 +32,7 @@ class TicketFormType extends SovTicketFormType
protected OrderShopStore $orderShopStore;
protected PriceSolver $priceSolver;
protected SectionStore $sectionStore;
protected TicketSolver $ticketSolver;

public function __construct(
Security $security,
@@ -43,13 +44,14 @@ class TicketFormType extends SovTicketFormType
PriceSolver $priceSolver,
SectionStore $sectionStore
) {
parent::__construct($entityManager, $translatorAdmin, $ticketSolver);
parent::__construct($entityManager, $translatorAdmin);

$this->security = $security;
$this->formComponent = $formComponent;
$this->orderShopStore = $orderShopStore;
$this->priceSolver = $priceSolver;
$this->sectionStore = $sectionStore;
$this->ticketSolver = $ticketSolver;
}

public function buildForm(FormBuilderInterface $builder, array $options)
@@ -99,7 +101,7 @@ class TicketFormType extends SovTicketFormType
[
'label' => 'Type',
'choices' => $this->translatorAdmin->transChoices(
TicketSolver::getTypeChoices(),
$this->ticketSolver->getTypeChoices('frontend'),
'Ticket',
'type'
),

+ 1
- 1
Solver/Ticket/TicketSolver.php Visa fil

@@ -7,7 +7,7 @@ use Lc\SovBundle\Solver\Ticket\TicketSolver as SovTicketSolver;

class TicketSolver extends SovTicketSolver
{
public static function getTypeChoices(): array
public function getTypeChoices($context = 'backend'): array
{
$choices = parent::getTypeChoices();
$choicesProduct = [

Laddar…
Avbryt
Spara