62 linhas
1.3KB

  1. <?php
  2. namespace Lc\ShopBundle\Model;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Lc\ShopBundle\Context\OrderPaymentInterface;
  5. use Lc\ShopBundle\Context\ReductionInterface;
  6. /**
  7. * @ORM\MappedSuperclass()
  8. */
  9. trait OrderPayoffTrait
  10. {
  11. use PayoffTrait;
  12. /**
  13. * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\OrderShopInterface", inversedBy="orderPayments")
  14. * @ORM\JoinColumn(nullable=false)
  15. */
  16. protected $orderShop;
  17. /**
  18. * @ORM\Column(type="boolean")
  19. */
  20. protected $editable;
  21. public function __toString()
  22. {
  23. return $this->amount. ' le '.$this->getPaidAt()->format('d-m-y').' par '.$this->getMeanPayment();
  24. }
  25. public function getOrderShop(): ?OrderShop
  26. {
  27. return $this->orderShop;
  28. }
  29. public function setOrderShop(?OrderShop $orderShop): self
  30. {
  31. $this->orderShop = $orderShop;
  32. return $this;
  33. }
  34. public function setEditable(bool $editable): self
  35. {
  36. $this->editable = $editable;
  37. return $this;
  38. }
  39. public function getEditable(): ?bool
  40. {
  41. return $this->editable;
  42. }
  43. public function isEditable(): ?bool
  44. {
  45. return $this->editable;
  46. }
  47. }