Charly пре 3 година
родитељ
комит
40be6694b9
4 измењених фајлова са 52 додато и 1 уклоњено
  1. +1
    -1
      Factory/FactoryTrait.php
  2. +39
    -0
      Factory/Ticket/TicketFactory.php
  3. +11
    -0
      Model/Ticket/TicketModel.php
  4. +1
    -0
      Resources/views/admin/Ticket/detail.html.twig

+ 1
- 1
Factory/FactoryTrait.php Прегледај датотеку

@@ -19,7 +19,7 @@ trait FactoryTrait
MerchantResolver $merchantResolver,
SectionResolver $sectionResolver
) {
parent::__construct($em);
$this->em = $em;
$this->merchantResolver = $merchantResolver;
$this->sectionResolver = $sectionResolver;
}

+ 39
- 0
Factory/Ticket/TicketFactory.php Прегледај датотеку

@@ -0,0 +1,39 @@
<?php

namespace Lc\CaracoleBundle\Factory\Ticket;

use Doctrine\ORM\EntityManagerInterface;
use Lc\CaracoleBundle\Factory\FactoryTrait;
use Lc\CaracoleBundle\Resolver\MerchantResolver;
use Lc\CaracoleBundle\Resolver\SectionResolver;
use Lc\SovBundle\Factory\Ticket\TicketFactory as SovTicketFactory;
use Lc\SovBundle\Factory\Ticket\TicketMessageFactory;

class TicketFactory extends SovTicketFactory
{
// use FactoryTrait;

protected $merchantResolver;
protected $sectionResolver;
protected $ticketMessageFactory;

public function __construct(
EntityManagerInterface $em,
MerchantResolver $merchantResolver,
SectionResolver $sectionResolver,
TicketMessageFactory $ticketMessageFactory
) {
parent::__construct($em, $ticketMessageFactory);
$this->merchantResolver = $merchantResolver;
$this->sectionResolver = $sectionResolver;
}

public function create($params = array())
{
if (!isset($params['merchant'])) {
$params['merchant'] = $this->merchantResolver->getCurrent();
}

return parent::create($params);
}
}

+ 11
- 0
Model/Ticket/TicketModel.php Прегледај датотеку

@@ -27,6 +27,17 @@ abstract class TicketModel extends SovTicketModel implements FilterMerchantInter
*/
protected $orderShop;

public function getChoicesType(): array
{
$choices = parent::getChoicesType();
$choicesProduct = [
'entity.Ticket.fields.typeOptions.' . TicketModel::TYPE_PRODUCT_UNAVAILABLE => TicketModel::TYPE_PRODUCT_UNAVAILABLE,
'entity.Ticket.fields.typeOptions.' . TicketModel::TYPE_PRODUCT_ERROR => TicketModel::TYPE_PRODUCT_ERROR
];

return array_merge($choices, $choicesProduct);
}

public function getMerchant(): MerchantInterface
{
return $this->merchant;

+ 1
- 0
Resources/views/admin/Ticket/detail.html.twig Прегледај датотеку

@@ -0,0 +1 @@
{% extends '@LcSov/admin/ticket/detail.html.twig' %}

Loading…
Откажи
Сачувај