Переглянути джерело

TicketSolver : gestion context getTypeChoices()

develop
Guillaume 2 роки тому
джерело
коміт
3987761815
2 змінених файлів з 5 додано та 3 видалено
  1. +4
    -2
      Form/Ticket/TicketFormType.php
  2. +1
    -1
      Solver/Ticket/TicketSolver.php

+ 4
- 2
Form/Ticket/TicketFormType.php Переглянути файл

@@ -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 Переглянути файл

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

Завантаження…
Відмінити
Зберегти