Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

OrderStatusHistoryModel.php 1.8KB

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