|
- <?php
-
- namespace Lc\CaracoleBundle\Model\Ticket;
-
- use Doctrine\ORM\Mapping as ORM;
- use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
- use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
- use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
- use Lc\SovBundle\Model\Ticket\TicketModel as SovTicketModel;
-
- /**
- * @ORM\MappedSuperclass()
- */
- abstract class TicketModel extends SovTicketModel implements FilterMerchantInterface
- {
- const TYPE_PRODUCT_UNAVAILABLE = 'product-unavailable';
- const TYPE_PRODUCT_ERROR = 'product-error';
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface")
- * @ORM\JoinColumn(nullable=false)
- */
- protected $merchant;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderShopInterface", inversedBy="tickets")
- */
- 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;
- }
-
- public function setMerchant(MerchantInterface $merchant): self
- {
- $this->merchant = $merchant;
-
- return $this;
- }
-
- public function getOrderShop(): OrderShopInterface
- {
- return $this->orderShop;
- }
-
- public function setOrderShop(OrderShopInterface $orderShop): self
- {
- $this->orderShop = $orderShop;
-
- return $this;
- }
-
- }
|