src/Entity/ProjectOwner.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProjectOwnerRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. /**
  9.  * TODO Replace Me!
  10.  * @deprecated use the Customer instead
  11.  * @ORM\Entity(repositoryClass=ProjectOwnerRepository::class)
  12.  */
  13. class ProjectOwner
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      * @Groups({
  20.      *     "project.owner",
  21.      *     "project.list.with.necessary.details",
  22.      *
  23.      *     "project.details",
  24.      *
  25.      *     "project_owner@core",
  26.      *     "project_owner@base"
  27.      * })
  28.      */
  29.     private $id;
  30.     /**
  31.      * @ORM\Column(type="string", length=255)
  32.      * @Groups({
  33.      *     "project.owner",
  34.      *     "project.list.with.necessary.details",
  35.      *
  36.      *     "project.details",
  37.      *
  38.      *     "project_owner@core",
  39.      *     "project_owner@base"
  40.      * })
  41.      */
  42.     private $company;
  43.     /**
  44.      * @ORM\ManyToOne(targetEntity=Countries::class, inversedBy="projectOwners")
  45.      * @Groups({
  46.      *     "project.owner",
  47.      *     "project_owner@company"
  48.      * })
  49.      */
  50.     private $country;
  51.     /**
  52.      * @ORM\Column(type="string", length=255, nullable=true)
  53.      * @Groups({
  54.      *     "project.owner",
  55.      *     "project.details",
  56.      *     "project_owner@core"
  57.      * })
  58.      */
  59.     private $city;
  60.     /**
  61.      * @ORM\OneToMany(targetEntity=Projects::class, mappedBy="owner")
  62.      */
  63.     private $projects;
  64.     /**
  65.      * TODO ReadMe!
  66.      * @deprecated use collaborators instead
  67.      * @ORM\OneToMany(targetEntity=ProjectOwnerContactPersons::class, mappedBy="project_owner", orphanRemoval=true, cascade={"persist", "remove"})
  68.      * @Groups({
  69.      *     "project.details",
  70.      *
  71.      *     "project_owner@contact_persons"
  72.      * })
  73.      */
  74.     private $project_owner_contact_persons;
  75.     /**
  76.      * @ORM\OneToMany(targetEntity=Invoices::class, mappedBy="customer")
  77.      */
  78.     private $invoices;
  79.     /**
  80.      * AI document extraction educations for this customer (project owner).
  81.      *
  82.      * @ORM\OneToMany(targetEntity=CustomerEducation::class, mappedBy="customer", orphanRemoval=true)
  83.      * @Groups({"project_owner@educations"})
  84.      */
  85.     private $customer_educations;
  86.     public function __construct()
  87.     {
  88.         $this->projects = new ArrayCollection();
  89.         $this->project_owner_contact_persons = new ArrayCollection();
  90.         $this->invoices = new ArrayCollection();
  91.         $this->customer_educations = new ArrayCollection();
  92.     }
  93.     public function getId(): ?int
  94.     {
  95.         return $this->id;
  96.     }
  97.     public function getCompany(): ?string
  98.     {
  99.         return $this->company;
  100.     }
  101.     public function setCompany(string $company): self
  102.     {
  103.         $this->company $company;
  104.         return $this;
  105.     }
  106.     public function getCountry(): ?Countries
  107.     {
  108.         return $this->country;
  109.     }
  110.     public function setCountry(?Countries $country): self
  111.     {
  112.         $this->country $country;
  113.         return $this;
  114.     }
  115.     public function getCity(): ?string
  116.     {
  117.         return $this->city;
  118.     }
  119.     public function setCity(?string $city): self
  120.     {
  121.         $this->city $city;
  122.         return $this;
  123.     }
  124.     /**
  125.      * @return Collection<int, Projects>
  126.      */
  127.     public function getProjects(): Collection
  128.     {
  129.         return $this->projects;
  130.     }
  131.     public function addProject(Projects $project): self
  132.     {
  133.         if (!$this->projects->contains($project)) {
  134.             $this->projects[] = $project;
  135.             $project->setOwner($this);
  136.         }
  137.         return $this;
  138.     }
  139.     public function removeProject(Projects $project): self
  140.     {
  141.         if ($this->projects->removeElement($project)) {
  142.             // set the owning side to null (unless already changed)
  143.             if ($project->getOwner() === $this) {
  144.                 $project->setOwner(null);
  145.             }
  146.         }
  147.         return $this;
  148.     }
  149.     /**
  150.      * TODO ReadMe!
  151.      * @deprecated use collaborators instead
  152.      * @return Collection<int, ProjectOwnerContactPersons>
  153.      */
  154.     public function getProjectOwnerContactPersons(): Collection
  155.     {
  156.         return $this->project_owner_contact_persons;
  157.     }
  158.     /**
  159.      * TODO ReadMe!
  160.      * @deprecated use collaborators instead
  161.      */
  162.     public function addProjectOwnerContactPerson(ProjectOwnerContactPersons $projectOwnerContactPerson): self
  163.     {
  164.         if (!$this->project_owner_contact_persons->contains($projectOwnerContactPerson)) {
  165.             $this->project_owner_contact_persons[] = $projectOwnerContactPerson;
  166.             $projectOwnerContactPerson->setProjectOwner($this);
  167.         }
  168.         return $this;
  169.     }
  170.     /**
  171.      * TODO ReadMe!
  172.      * @deprecated use collaborators instead
  173.      */
  174.     public function removeProjectOwnerContactPerson(ProjectOwnerContactPersons $projectOwnerContactPerson): self
  175.     {
  176.         if ($this->project_owner_contact_persons->removeElement($projectOwnerContactPerson)) {
  177.             // set the owning side to null (unless already changed)
  178.             if ($projectOwnerContactPerson->getProjectOwner() === $this) {
  179.                 $projectOwnerContactPerson->setProjectOwner(null);
  180.             }
  181.         }
  182.         return $this;
  183.     }
  184.     /**
  185.      * @return Collection<int, Invoices>
  186.      */
  187.     public function getInvoices(): Collection
  188.     {
  189.         return $this->invoices;
  190.     }
  191.     public function addInvoice(Invoices $invoice): self
  192.     {
  193.         if (!$this->invoices->contains($invoice)) {
  194.             $this->invoices[] = $invoice;
  195.             $invoice->setCustomer($this);
  196.         }
  197.         return $this;
  198.     }
  199.     public function removeInvoice(Invoices $invoice): self
  200.     {
  201.         if ($this->invoices->removeElement($invoice)) {
  202.             // set the owning side to null (unless already changed)
  203.             if ($invoice->getCustomer() === $this) {
  204.                 $invoice->setCustomer(null);
  205.             }
  206.         }
  207.         return $this;
  208.     }
  209.     /**
  210.      * @return Collection<int, CustomerEducation>
  211.      */
  212.     public function getCustomerEducations(): Collection
  213.     {
  214.         return $this->customer_educations;
  215.     }
  216.     public function addCustomerEducation(CustomerEducation $customerEducation): self
  217.     {
  218.         if (!$this->customer_educations->contains($customerEducation)) {
  219.             $this->customer_educations[] = $customerEducation;
  220.             $customerEducation->setCustomer($this);
  221.         }
  222.         return $this;
  223.     }
  224.     public function removeCustomerEducation(CustomerEducation $customerEducation): self
  225.     {
  226.         if ($this->customer_educations->removeElement($customerEducation)) {
  227.             // set the owning side to null (unless already changed)
  228.             if ($customerEducation->getCustomer() === $this) {
  229.                 $customerEducation->setCustomer(null);
  230.             }
  231.         }
  232.         return $this;
  233.     }
  234. }