src/Core/Domain/Model/Insales/Order.php line 11

  1. <?php
  2.     
  3.     namespace App\Core\Domain\Model\Insales;
  4.     
  5.     use App\Core\Domain\Model;
  6.     use Doctrine\ORM\Mapping as ORM;
  7.     #[ORM\Entity]
  8.     #[ORM\Table(name'orders')]
  9.     #[ORM\HasLifecycleCallbacks]
  10.     class Order
  11.     {
  12.         public const ORDER_PAYMENT_PAYED 'paid';
  13.         
  14.         use Model\Traits\Id;
  15.         use Model\Traits\Dates;
  16.         use Model\Traits\Uuid;
  17.         
  18.         #[ORM\ManyToOne(targetEntityModel\Insales\Application::class)]
  19.         #[ORM\JoinColumn(onDelete'CASCADE')]
  20.         private Model\Insales\Application $application;
  21.         
  22.         #[ORM\ManyToOne(targetEntityModel\Insales\Client::class, cascade: ['persist'])]
  23.         #[ORM\JoinColumn(onDelete'CASCADE')]
  24.         private ?Model\Insales\Client $client null;
  25.         
  26.         #[ORM\Column(type'boolean'options: ['default' => true])]
  27.         private bool $payed false;
  28.         
  29.         #[ORM\Column(type'bigint'options: ['unsigned' => true])]
  30.         private int $orderId;
  31.         
  32.         #[ORM\Column(type'string'length255)]
  33.         private string $orderNumber;
  34.     
  35.         #[ORM\Column(type'float'scale2options: ['default' => 0'unsigned' => true])]
  36.         private float $orderPrice 0;
  37.     
  38.         #[ORM\Column(type'float'scale2options: ['default' => 0'unsigned' => true])]
  39.         private float $deliveryPrice 0;
  40.         
  41.         #[ORM\Column(type'datetime')]
  42.         private \DateTime $createOrderAt;
  43.     
  44.         /**
  45.          * @return Application
  46.          */
  47.         public function getApplication(): Application
  48.         {
  49.             return $this->application;
  50.         }
  51.     
  52.         /**
  53.          * @param Application $application
  54.          * @return Order
  55.          */
  56.         public function setApplication(Application $application): Order
  57.         {
  58.             $this->application $application;
  59.             return $this;
  60.         }
  61.     
  62.         /**
  63.          * @return bool
  64.          */
  65.         public function isPayed(): bool
  66.         {
  67.             return $this->payed;
  68.         }
  69.     
  70.         /**
  71.          * @param bool $payed
  72.          * @return Order
  73.          */
  74.         public function setPayed(bool $payed): Order
  75.         {
  76.             $this->payed $payed;
  77.             return $this;
  78.         }
  79.     
  80.         /**
  81.          * @return int
  82.          */
  83.         public function getOrderId(): int
  84.         {
  85.             return $this->orderId;
  86.         }
  87.     
  88.         /**
  89.          * @param int $orderId
  90.          * @return Order
  91.          */
  92.         public function setOrderId(int $orderId): Order
  93.         {
  94.             $this->orderId $orderId;
  95.             return $this;
  96.         }
  97.     
  98.         /**
  99.          * @return \DateTime
  100.          */
  101.         public function getCreateOrderAt(): \DateTime
  102.         {
  103.             return $this->createOrderAt;
  104.         }
  105.     
  106.         /**
  107.          * @param \DateTime $createOrderAt
  108.          * @return Order
  109.          */
  110.         public function setCreateOrderAt(\DateTime $createOrderAt): Order
  111.         {
  112.             $this->createOrderAt $createOrderAt;
  113.             return $this;
  114.         }
  115.     
  116.         /**
  117.          * @return string
  118.          */
  119.         public function getOrderNumber(): string
  120.         {
  121.             return $this->orderNumber;
  122.         }
  123.     
  124.         /**
  125.          * @param string $orderNumber
  126.          * @return Order
  127.          */
  128.         public function setOrderNumber(string $orderNumber): Order
  129.         {
  130.             $this->orderNumber $orderNumber;
  131.             return $this;
  132.         }
  133.     
  134.         /**
  135.          * @return float
  136.          */
  137.         public function getOrderPrice(): float
  138.         {
  139.             return $this->orderPrice;
  140.         }
  141.     
  142.         /**
  143.          * @param float $orderPrice
  144.          * @return Order
  145.          */
  146.         public function setOrderPrice(float $orderPrice): Order
  147.         {
  148.             $this->orderPrice $orderPrice;
  149.             return $this;
  150.         }
  151.     
  152.         /**
  153.          * @return float
  154.          */
  155.         public function getDeliveryPrice(): float
  156.         {
  157.             return $this->deliveryPrice;
  158.         }
  159.     
  160.         /**
  161.          * @param float $deliveryPrice
  162.          * @return Order
  163.          */
  164.         public function setDeliveryPrice(float $deliveryPrice): Order
  165.         {
  166.             $this->deliveryPrice $deliveryPrice;
  167.             return $this;
  168.         }
  169.     
  170.         /**
  171.          * @return Client|null
  172.          */
  173.         public function getClient(): ?Client
  174.         {
  175.             return $this->client;
  176.         }
  177.     
  178.         /**
  179.          * @param null|Client $client
  180.          * @return Order
  181.          */
  182.         public function setClient(?Client $client): Order
  183.         {
  184.             $this->client $client;
  185.             return $this;
  186.         }
  187.     }