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.      * @var int|null
  38.      *
  39.      * @ORM\Column(name="id_order", type="integer", length=11, nullable=true)
  40.      */
  41.     private $orderId;
  42.     /**
  43.      * @var int|null
  44.      *
  45.      * @ORM\Column(name="id_product", type="integer", length=11, nullable=true)
  46.      */
  47.     private $productId;
  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 ServiceCustomerParameter
  70.      *
  71.      * @ORM\OneToMany(targetEntity="App\Entity\System\ServiceCustomerParameter", mappedBy="serviceCustomer", cascade={"persist"})
  72.      */
  73.     private $serviceCustomerParameter;
  74.     public function __construct()
  75.     {
  76.         $this->serviceCustomerParameter = 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.     /**
  131.      * @return int|null
  132.      */
  133.     public function getOrderId(): ?int
  134.     {
  135.         return $this->orderId;
  136.     }
  137.     /**
  138.      * @param int|null $orderId
  139.      *
  140.      * @return ServiceCustomer
  141.      */
  142.     public function setOrderId(?int $orderId): ServiceCustomer
  143.     {
  144.         $this->orderId $orderId;
  145.         return $this;
  146.     }
  147.     /**
  148.      * @return int|null
  149.      */
  150.     public function getProductId(): ?int
  151.     {
  152.         return $this->productId;
  153.     }
  154.     /**
  155.      * @param int|null $productId
  156.      *
  157.      * @return ServiceCustomer
  158.      */
  159.     public function setProductId(?int $productId): ServiceCustomer
  160.     {
  161.         $this->productId $productId;
  162.         return $this;
  163.     }
  164.     /**
  165.      * @return bool|null
  166.      */
  167.     public function getActive(): ?bool
  168.     {
  169.         return $this->active;
  170.     }
  171.     /**
  172.      * @param bool|null $active
  173.      *
  174.      * @return ServiceCustomer
  175.      */
  176.     public function setActive(?bool $active): ServiceCustomer
  177.     {
  178.         $this->active $active;
  179.         return $this;
  180.     }
  181.     /**
  182.      * @return \DateTime|null
  183.      */
  184.     public function getDateAdd(): ?\DateTime
  185.     {
  186.         return $this->dateAdd;
  187.     }
  188.     /**
  189.      * @param \DateTime|null $dateAdd
  190.      *
  191.      * @return ServiceCustomer
  192.      */
  193.     public function setDateAdd(?\DateTime $dateAdd): ServiceCustomer
  194.     {
  195.         $this->dateAdd $dateAdd;
  196.         return $this;
  197.     }
  198.     /**
  199.      * @return ServiceCustomerParameter
  200.      */
  201.     public function getServiceCustomerParameter()
  202.     {
  203.         return $this->serviceCustomerParameter;
  204.     }
  205.     /**
  206.      * @param ServiceCustomerParameter $serviceCustomerParameter
  207.      *
  208.      * @return ServiceCustomer
  209.      */
  210.     public function setServiceCustomerParameter(ServiceCustomerParameter $serviceCustomerParameter): ServiceCustomer
  211.     {
  212.         $this->serviceCustomerParameter $serviceCustomerParameter;
  213.         return $this;
  214.     }
  215.     public function getOrderDetail(): ?OrderDetail
  216.     {
  217.         return $this->orderDetail;
  218.     }
  219.     public function setOrderDetail(?OrderDetail $orderDetail): ServiceCustomer
  220.     {
  221.         $this->orderDetail $orderDetail;
  222.         return $this;
  223.     }
  224.     /**
  225.      * @param Customer $customer
  226.      * @param Service $service
  227.      */
  228.     public function initializeCustomerAndService(Customer $customerService $service): void
  229.     {
  230.         $this->customer $customer;
  231.         $this->service $service;
  232.         $this->active true;
  233.         $this->dateAdd = new \DateTime();
  234.     }
  235. }