85 lines
2.1KB

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