src/Entity/System/ServiceCustomer.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Table(name="ps_service_customer")
  7.  *
  8.  * @ORM\Entity(repositoryClass="App\Repository\System\ServiceCustomerRepository")
  9.  */
  10. class ServiceCustomer
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      *
  15.      * @ORM\GeneratedValue(strategy="AUTO")
  16.      *
  17.      * @ORM\Column(name="id_service_customer", type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @var Service
  22.      *
  23.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Service", inversedBy="serviceCustomer")
  24.      *
  25.      * @ORM\JoinColumn(name="id_service", referencedColumnName="id_service")
  26.      */
  27.     private $service;
  28.     /**
  29.      * @var Customer
  30.      *
  31.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Customer", inversedBy="serviceCustomer")
  32.      *
  33.      * @ORM\JoinColumn(name="id_customer", referencedColumnName="id_customer")
  34.      */
  35.     private $customer;
  36.     /**
  37.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Order")
  38.      *
  39.      * @ORM\JoinColumn(name="id_order", referencedColumnName="id_order")
  40.      */
  41.     private ?Order $order;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Product")
  44.      *
  45.      * @ORM\JoinColumn(name="id_product", referencedColumnName="id_product")
  46.      */
  47.     private ?Product $product;
  48.     /**
  49.      * @var bool|null
  50.      *
  51.      * @ORM\Column(type="boolean", columnDefinition="tinyint(4)", nullable=true)
  52.      */
  53.     private $active;
  54.     /**
  55.      * @var \DateTime|null
  56.      *
  57.      * @ORM\Column(type="datetime", nullable=true)
  58.      */
  59.     private $dateAdd;
  60.     /**
  61.      * @var OrderDetail|null
  62.      *
  63.      * @ORM\ManyToOne(targetEntity="App\Entity\System\OrderDetail")
  64.      *
  65.      * @ORM\JoinColumn(name="id_order_detail", referencedColumnName="id_order_detail")
  66.      */
  67.     private ?OrderDetail $orderDetail;
  68.     /**
  69.      * @var ArrayCollection<int, ServiceCustomerParameter>|ServiceCustomerParameter[]
  70.      *
  71.      * @ORM\OneToMany(targetEntity="App\Entity\System\ServiceCustomerParameter", mappedBy="serviceCustomer", cascade={"persist"})
  72.      */
  73.     private $serviceCustomerParameters;
  74.     public function __construct()
  75.     {
  76.         $this->serviceCustomerParameters = new ArrayCollection();
  77.         $this->dateAdd = new \DateTime();
  78.     }
  79.     /**
  80.      * @return mixed
  81.      */
  82.     public function getId()
  83.     {
  84.         return $this->id;
  85.     }
  86.     /**
  87.      * @param mixed $id
  88.      *
  89.      * @return ServiceCustomer
  90.      */
  91.     public function setId($id): ServiceCustomer
  92.     {
  93.         $this->id $id;
  94.         return $this;
  95.     }
  96.     /**
  97.      * @return Service
  98.      */
  99.     public function getService(): Service
  100.     {
  101.         return $this->service;
  102.     }
  103.     /**
  104.      * @param Service $service
  105.      *
  106.      * @return ServiceCustomer
  107.      */
  108.     public function setService(Service $service): ServiceCustomer
  109.     {
  110.         $this->service $service;
  111.         return $this;
  112.     }
  113.     /**
  114.      * @return Customer
  115.      */
  116.     public function getCustomer(): Customer
  117.     {
  118.         return $this->customer;
  119.     }
  120.     /**
  121.      * @param Customer $customer
  122.      *
  123.      * @return ServiceCustomer
  124.      */
  125.     public function setCustomer(Customer $customer): ServiceCustomer
  126.     {
  127.         $this->customer $customer;
  128.         return $this;
  129.     }
  130.     public function setOrder(?Order $order): ServiceCustomer
  131.     {
  132.         $this->order $order;
  133.         return $this;
  134.     }
  135.     public function getOrder(): ?Order
  136.     {
  137.         return $this->order;
  138.     }
  139.     public function getProduct(): ?Product
  140.     {
  141.         return $this->product;
  142.     }
  143.     public function setProduct(?Product $product): ServiceCustomer
  144.     {
  145.         $this->product $product;
  146.         return $this;
  147.     }
  148.     /**
  149.      * @return bool|null
  150.      */
  151.     public function getActive(): ?bool
  152.     {
  153.         return $this->active;
  154.     }
  155.     /**
  156.      * @param bool|null $active
  157.      *
  158.      * @return ServiceCustomer
  159.      */
  160.     public function setActive(?bool $active): ServiceCustomer
  161.     {
  162.         $this->active $active;
  163.         return $this;
  164.     }
  165.     /**
  166.      * @return \DateTime|null
  167.      */
  168.     public function getDateAdd(): ?\DateTime
  169.     {
  170.         return $this->dateAdd;
  171.     }
  172.     /**
  173.      * @param \DateTime|null $dateAdd
  174.      *
  175.      * @return ServiceCustomer
  176.      */
  177.     public function setDateAdd(?\DateTime $dateAdd): ServiceCustomer
  178.     {
  179.         $this->dateAdd $dateAdd;
  180.         return $this;
  181.     }
  182.     /**
  183.      * @return ArrayCollection<int, ServiceCustomerParameter>|ServiceCustomerParameter[]
  184.      */
  185.     public function getServiceCustomerParameters()
  186.     {
  187.         return $this->serviceCustomerParameters;
  188.     }
  189.     /**
  190.      * @param ArrayCollection<int, ServiceCustomerParameter>|ServiceCustomerParameter[] $serviceCustomerParameters
  191.      */
  192.     public function setServiceCustomerParameters($serviceCustomerParameters): ServiceCustomer
  193.     {
  194.         $this->serviceCustomerParameters $serviceCustomerParameters;
  195.         return $this;
  196.     }
  197.     public function getOrderDetail(): ?OrderDetail
  198.     {
  199.         return $this->orderDetail;
  200.     }
  201.     public function setOrderDetail(?OrderDetail $orderDetail): ServiceCustomer
  202.     {
  203.         $this->orderDetail $orderDetail;
  204.         return $this;
  205.     }
  206.     /**
  207.      * @param Customer $customer
  208.      * @param Service $service
  209.      */
  210.     public function initializeCustomerAndService(Customer $customerService $service): void
  211.     {
  212.         $this->customer $customer;
  213.         $this->service $service;
  214.         $this->active true;
  215.         $this->dateAdd = new \DateTime();
  216.     }
  217. }