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.

89 lines
2.0KB

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