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.

80 line
1.8KB

  1. <?php
  2. namespace Lc\CaracoleBundle\Model\Order;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
  5. /**
  6. * @ORM\MappedSuperclass()
  7. */
  8. abstract class OrderStatusHistoryModel extends AbstractLightEntity implements OrderStatusHistoryInterface
  9. {
  10. /**
  11. * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderShopInterface", inversedBy="orderStatusHistories")
  12. * @ORM\JoinColumn(nullable=false)
  13. */
  14. protected $orderShop;
  15. /**
  16. * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderStatusInterface")
  17. * @ORM\JoinColumn(nullable=false)
  18. */
  19. protected $orderStatus;
  20. const ORIGIN_USER = 'user';
  21. const ORIGIN_ADMIN = 'admin';
  22. const ORIGIN_SYSTEM = 'system';
  23. /**
  24. * @ORM\Column(type="string", length=31)
  25. */
  26. protected $origin;
  27. public function __toString()
  28. {
  29. return $this->getOrderStatus()->getAlias() . ' le : ' . $this->getCreatedAt()->format(
  30. 'd-m-Y H:i'
  31. ) . '(' . $this->getOrigin() . ')';
  32. }
  33. public function getOrderShop(): ?OrderShopInterface
  34. {
  35. return $this->orderShop;
  36. }
  37. public function setOrderShop(?OrderShopInterface $orderShop): self
  38. {
  39. $this->orderShop = $orderShop;
  40. return $this;
  41. }
  42. public function getOrderStatus(): ?OrderStatusInterface
  43. {
  44. return $this->orderStatus;
  45. }
  46. public function setOrderStatus(?OrderStatusInterface $orderStatus): self
  47. {
  48. $this->orderStatus = $orderStatus;
  49. return $this;
  50. }
  51. public function getOrigin(): ?string
  52. {
  53. return $this->origin;
  54. }
  55. public function setOrigin(string $origin): self
  56. {
  57. $this->origin = $origin;
  58. return $this;
  59. }
  60. }