You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.6KB

  1. <?php
  2. namespace Lc\CaracoleBundle\Model\Ticket;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
  5. use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
  6. use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
  7. use Lc\SovBundle\Model\Ticket\TicketModel as SovTicketModel;
  8. /**
  9. * @ORM\MappedSuperclass()
  10. */
  11. abstract class TicketModel extends SovTicketModel implements FilterMerchantInterface
  12. {
  13. const TYPE_PRODUCT_UNAVAILABLE = 'product-unavailable';
  14. const TYPE_PRODUCT_ERROR = 'product-error';
  15. /**
  16. * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface")
  17. * @ORM\JoinColumn(nullable=false)
  18. */
  19. protected $merchant;
  20. /**
  21. * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderShopInterface", inversedBy="tickets")
  22. */
  23. protected $orderShop;
  24. public function getTypeChoices(): array
  25. {
  26. $choices = parent::getTypeChoices();
  27. $choicesProduct = [
  28. TicketModel::TYPE_PRODUCT_UNAVAILABLE,
  29. TicketModel::TYPE_PRODUCT_ERROR
  30. ];
  31. return array_merge($choices, $choicesProduct);
  32. }
  33. public function getMerchant(): MerchantInterface
  34. {
  35. return $this->merchant;
  36. }
  37. public function setMerchant(MerchantInterface $merchant): self
  38. {
  39. $this->merchant = $merchant;
  40. return $this;
  41. }
  42. public function getOrderShop(): OrderShopInterface
  43. {
  44. return $this->orderShop;
  45. }
  46. public function setOrderShop(OrderShopInterface $orderShop): self
  47. {
  48. $this->orderShop = $orderShop;
  49. return $this;
  50. }
  51. }