Browse Source

TicketSolver : gestion context getTypeChoices()

develop
Guillaume 2 years ago
parent
commit
3987761815
2 changed files with 5 additions and 3 deletions
  1. +4
    -2
      Form/Ticket/TicketFormType.php
  2. +1
    -1
      Solver/Ticket/TicketSolver.php

+ 4
- 2
Form/Ticket/TicketFormType.php View File

@@ -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 View File

@@ -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 = [

Loading…
Cancel
Save