|
- <?php
-
- namespace Lc\CaracoleBundle\Model\Order;
-
- use Doctrine\ORM\Mapping as ORM;
- use Gedmo\Mapping\Annotation as Gedmo;
- use Lc\SovBundle\Doctrine\Extension\BlameableNullableTrait;
- use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
-
-
- /**
- * @ORM\MappedSuperclass()
- */
- abstract class OrderStatusHistoryModel extends AbstractLightEntity
- {
-
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderShopInterface", inversedBy="orderStatusHistories")
- * @ORM\JoinColumn(nullable=false)
- */
- protected $orderShop;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderStatusInterface")
- * @ORM\JoinColumn(nullable=false)
- */
- protected $orderStatus;
-
- const ORIGIN_USER = 'user';
- const ORIGIN_ADMIN = 'admin';
- const ORIGIN_SYSTEM = 'system';
-
- /**
- * @ORM\Column(type="string", length=31)
- */
- protected $origin;
-
- public function __toString()
- {
- return $this->getOrderStatus()->getAlias() . ' le : ' . $this->getCreatedAt()->format(
- 'd-m-Y H:i'
- ) . '(' . $this->getOrigin() . ')';
- }
-
- public function getOrderShop(): ?OrderShopInterface
- {
- return $this->orderShop;
- }
-
- public function setOrderShop(?OrderShopInterface $orderShop): self
- {
- $this->orderShop = $orderShop;
-
- return $this;
- }
-
- public function getOrderStatus(): ?OrderStatusInterface
- {
- return $this->orderStatus;
- }
-
- public function setOrderStatus(?OrderStatusInterface $orderStatus): self
- {
- $this->orderStatus = $orderStatus;
-
- return $this;
- }
-
- public function getOrigin(): ?string
- {
- return $this->origin;
- }
-
- public function setOrigin(string $origin): self
- {
- $this->origin = $origin;
-
- return $this;
- }
- }
|