|
|
@@ -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); |
|
|
|
} |
|
|
|
} |