src/Entity/System/ServiceCustomer.php line 19

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