src/Entity/Gos/Participants.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use App\Entity\Gos\Uniqskills\UserCertificate;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Table()
  9.  * @ORM\Entity(repositoryClass="App\Repository\ParticipantsRepository")
  10.  * @ORM\HasLifecycleCallbacks()
  11.  */
  12. class Participants
  13. {
  14.     /**
  15.      * @ORM\Id()
  16.      * @ORM\GeneratedValue()
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Orders", inversedBy="participants")
  22.      */
  23.     private $orders;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\ProductVariant", inversedBy="participantsPrimary")
  26.      * @ORM\JoinColumn()
  27.      */
  28.     private $primaryProductVariant;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true)
  31.      */
  32.     private $firstName;
  33.     /**
  34.      * @ORM\Column(type="string", length=255, nullable=true)
  35.      */
  36.     private $lastName;
  37.     /**
  38.      * @ORM\Column(type="string", length=30, nullable=true)
  39.      */
  40.     private $phoneNumber;
  41.     /**
  42.      * @ORM\Column(type="string", length=255)
  43.      */
  44.     private $email;
  45.     /**
  46.      * @ORM\Column(type="string", length=255, nullable=true)
  47.      */
  48.     private $position;
  49.     /**
  50.      * @ORM\Column(type="datetime")
  51.      */
  52.     private $createdAt;
  53.     /**
  54.      * @ORM\Column(type="datetime", nullable=true)
  55.      */
  56.     private $updatedAt;
  57.     /**
  58.      * @ORM\Column(type="string", length=255, nullable=true)
  59.      */
  60.     private $address;
  61.     /**
  62.      * @ORM\Column(type="string", length=255, nullable=true)
  63.      */
  64.     private $postalCode;
  65.     /**
  66.      * @ORM\Column(type="string", length=255, nullable=true)
  67.      */
  68.     private $city;
  69.     /**
  70.      * @ORM\OneToMany(targetEntity=UserCertificate::class, mappedBy="participant")
  71.      */
  72.     private $userCertificate;
  73.     /**
  74.      * @ORM\Column(type="boolean", nullable=true)
  75.      */
  76.     private $productDuplicationMessageDisplayed;
  77.     /**
  78.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\OrderProductVariant", mappedBy="participant")
  79.      */
  80.     private $orderProductVariants;
  81.     /**
  82.      * Participants constructor.
  83.      */
  84.     public function __construct()
  85.     {
  86.         $this->createdAt = new \DateTime();
  87.         $this->userCertificate = new ArrayCollection();
  88.         $this->orderProductVariants = new ArrayCollection();
  89.     }
  90.     /** @ORM\PrePersist() */
  91.     public function prePersist()
  92.     {
  93.         $this->createdAt = new \DateTime();
  94.     }
  95.     /** @ORM\PreUpdate() */
  96.     public function preUpdate()
  97.     {
  98.         $this->updatedAt = new \DateTime();
  99.     }
  100.     /**
  101.      * @return array
  102.      */
  103.     public function getObjectVars()
  104.     {
  105.         return get_object_vars($this);
  106.     }
  107.     /**
  108.      * @return mixed
  109.      */
  110.     public function getId()
  111.     {
  112.         return $this->id;
  113.     }
  114.     /**
  115.      * @param mixed $id
  116.      */
  117.     public function setId($id): void
  118.     {
  119.         $this->id $id;
  120.     }
  121.     /**
  122.      * @return mixed
  123.      */
  124.     public function getOrders()
  125.     {
  126.         return $this->orders;
  127.     }
  128.     /**
  129.      * @param mixed $orders
  130.      */
  131.     public function setOrders($orders): void
  132.     {
  133.         $this->orders $orders;
  134.     }
  135.     /**
  136.      * @return mixed
  137.      */
  138.     public function getPrimaryProductVariant()
  139.     {
  140.         return $this->primaryProductVariant;
  141.     }
  142.     /**
  143.      * @param mixed $primaryProductVariant
  144.      */
  145.     public function setPrimaryProductVariant($primaryProductVariant): void
  146.     {
  147.         $this->primaryProductVariant $primaryProductVariant;
  148.     }
  149.     /**
  150.      * @return mixed
  151.      */
  152.     public function getFirstName()
  153.     {
  154.         return $this->firstName;
  155.     }
  156.     /**
  157.      * @param mixed $firstName
  158.      */
  159.     public function setFirstName($firstName): void
  160.     {
  161.         $this->firstName $firstName;
  162.     }
  163.     /**
  164.      * @return mixed
  165.      */
  166.     public function getLastName()
  167.     {
  168.         return $this->lastName;
  169.     }
  170.     /**
  171.      * @param mixed $lastName
  172.      */
  173.     public function setLastName($lastName): void
  174.     {
  175.         $this->lastName $lastName;
  176.     }
  177.     /**
  178.      * @return mixed
  179.      */
  180.     public function getPhoneNumber()
  181.     {
  182.         return $this->phoneNumber;
  183.     }
  184.     /**
  185.      * @param mixed $phoneNumber
  186.      */
  187.     public function setPhoneNumber($phoneNumber): void
  188.     {
  189.         $this->phoneNumber $phoneNumber;
  190.     }
  191.     /**
  192.      * @return mixed
  193.      */
  194.     public function getEmail()
  195.     {
  196.         return $this->email;
  197.     }
  198.     /**
  199.      * @param mixed $email
  200.      */
  201.     public function setEmail($email): void
  202.     {
  203.         $this->email $email;
  204.     }
  205.     /**
  206.      * @return mixed
  207.      */
  208.     public function getPosition()
  209.     {
  210.         return $this->position;
  211.     }
  212.     /**
  213.      * @param mixed $position
  214.      */
  215.     public function setPosition($position): void
  216.     {
  217.         $this->position $position;
  218.     }
  219.     /**
  220.      * @return mixed
  221.      */
  222.     public function getCreatedAt()
  223.     {
  224.         return $this->createdAt;
  225.     }
  226.     /**
  227.      * @param mixed $createdAt
  228.      */
  229.     public function setCreatedAt($createdAt): void
  230.     {
  231.         $this->createdAt $createdAt;
  232.     }
  233.     /**
  234.      * @return mixed
  235.      */
  236.     public function getUpdatedAt()
  237.     {
  238.         return $this->updatedAt;
  239.     }
  240.     /**
  241.      * @param mixed $updatedAt
  242.      */
  243.     public function setUpdatedAt($updatedAt): void
  244.     {
  245.         $this->updatedAt $updatedAt;
  246.     }
  247.     public function getAddress(): ?string
  248.     {
  249.         return $this->address;
  250.     }
  251.     public function setAddress(?string $address): self
  252.     {
  253.         $this->address $address;
  254.         return $this;
  255.     }
  256.     public function getPostalCode(): ?string
  257.     {
  258.         return $this->postalCode;
  259.     }
  260.     public function setPostalCode(?string $postalCode): self
  261.     {
  262.         $this->postalCode $postalCode;
  263.         return $this;
  264.     }
  265.     public function getCity(): ?string
  266.     {
  267.         return $this->city;
  268.     }
  269.     public function setCity(?string $city): self
  270.     {
  271.         $this->city $city;
  272.         return $this;
  273.     }
  274.     /**
  275.      * @return Collection|UserCertificate[]
  276.      */
  277.     public function getUserCertificate(): Collection
  278.     {
  279.         return $this->userCertificate;
  280.     }
  281.     public function addUserCertificate(UserCertificate $userCertificate): self
  282.     {
  283.         if (!$this->userCertificate->contains($userCertificate)) {
  284.             $this->userCertificate[] = $userCertificate;
  285.             $userCertificate->setParticipant($this);
  286.         }
  287.         return $this;
  288.     }
  289.     public function removeUserCertificate(UserCertificate $userCertificate): self
  290.     {
  291.         if ($this->userCertificate->contains($userCertificate)) {
  292.             $this->userCertificate->removeElement($userCertificate);
  293.             // set the owning side to null (unless already changed)
  294.             if ($userCertificate->getParticipant() === $this) {
  295.                 $userCertificate->setParticipant(null);
  296.             }
  297.         }
  298.         return $this;
  299.     }
  300.     public function getProductDuplicationMessageDisplayed(): ?bool
  301.     {
  302.         return $this->productDuplicationMessageDisplayed;
  303.     }
  304.     public function setProductDuplicationMessageDisplayed(?bool $productDuplicationMessageDisplayed): self
  305.     {
  306.         $this->productDuplicationMessageDisplayed $productDuplicationMessageDisplayed;
  307.         return $this;
  308.     }
  309.     /**
  310.      * @return Collection|OrderProductVariant[]
  311.      */
  312.     public function getOrderProductVariants(): Collection
  313.     {
  314.         return $this->orderProductVariants;
  315.     }
  316.     public function addOrderProductVariant(OrderProductVariant $orderProductVariant): self
  317.     {
  318.         if (!$this->orderProductVariants->contains($orderProductVariant)) {
  319.             $this->orderProductVariants[] = $orderProductVariant;
  320.             $orderProductVariant->setParticipant($this);
  321.         }
  322.         return $this;
  323.     }
  324.     public function removeOrderProductVariant(OrderProductVariant $orderProductVariant): self
  325.     {
  326.         if ($this->orderProductVariants->contains($orderProductVariant)) {
  327.             $this->orderProductVariants->removeElement($orderProductVariant);
  328.             // set the owning side to null (unless already changed)
  329.             if ($orderProductVariant->getParticipant() === $this) {
  330.                 $orderProductVariant->setParticipant(null);
  331.             }
  332.         }
  333.         return $this;
  334.     }
  335. }