<?php
namespace App\Entity;
use App\Repository\CertificatesRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity(repositoryClass=CertificatesRepository::class)
*/
class Certificates
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({
* "certificates.base",
* "customer.certificate.manage",
* "customer.manage.base",
* "project.certificates",
* "customer.joined.projects.depended.certificates",
* "stakeholder.selected.core.project.manage",
* "worker.manage.base",
* "worker.certificate.manage",
* "selected.customer.project.for.worker"
* })
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
* @Groups({
* "certificates.base",
* "customer.certificate.manage",
* "customer.manage.base",
* "project.certificates",
* "customer.joined.projects.depended.certificates",
* "stakeholder.selected.core.project.manage",
* "worker.manage.base",
* "worker.certificate.manage",
* "selected.customer.project.for.worker"
* })
*/
private $name;
/**
* @ORM\Column(type="string", length=255)
* @Groups({
* "certificates.base",
* "customer.manage.base",
* "project.certificates",
* "customer.joined.projects.depended.certificates",
* "stakeholder.selected.core.project.manage",
* "worker.manage.base",
* "worker.certificate.manage",
* "selected.customer.project.for.worker"
* })
*/
private $color;
/**
* @ORM\OneToMany(targetEntity=WorkerCertificates::class, mappedBy="certificate")
*/
private $workerCertificates;
/**
* @ORM\ManyToOne(targetEntity=CertificatesGroups::class, inversedBy="certificates")
* @ORM\JoinColumn(nullable=false)
* @Groups({
* "certificate.group.base",
* })
*/
private $groups;
/**
* @ORM\OneToMany(targetEntity=CustomerCertificates::class, mappedBy="certificate")
*/
private $customerCertificates;
/**
* @ORM\ManyToMany(targetEntity=ProjectStakeholders::class, mappedBy="dependent_certificates")
*/
private $projectStakeholders;
/**
* @ORM\ManyToMany(targetEntity=Projects::class, mappedBy="dependent_certificates")
*/
private $projects;
/**
* @ORM\ManyToOne(targetEntity=CertificateEligibilities::class, inversedBy="certificates")
* @Groups({"certificates.base", "project.certificates", "customer.joined.projects.depended.certificates.eligibility"})
*/
private $certificate_eligibility;
public function __construct()
{
$this->workerCertificates = new ArrayCollection();
$this->customerCertificates = new ArrayCollection();
$this->projectStakeholders = new ArrayCollection();
$this->projects = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getColor(): ?string
{
return $this->color;
}
public function setColor(string $color): self
{
$this->color = $color;
return $this;
}
/**
* @return Collection<int, WorkerCertificates>
*/
// public function getWorkerCertificates(): Collection
// {
// return $this->workerCertificates;
// }
public function addWorkerCertificate(WorkerCertificates $workerCertificate): self
{
if (!$this->workerCertificates->contains($workerCertificate)) {
$this->workerCertificates[] = $workerCertificate;
$workerCertificate->setCertificate($this);
}
return $this;
}
public function removeWorkerCertificate(WorkerCertificates $workerCertificate): self
{
if ($this->workerCertificates->removeElement($workerCertificate)) {
// set the owning side to null (unless already changed)
if ($workerCertificate->getCertificate() === $this) {
$workerCertificate->setCertificate(null);
}
}
return $this;
}
// public function getGroups(): ?CertificatesGroups
// {
// return $this->groups;
// }
public function setGroups(?CertificatesGroups $groups): self
{
$this->groups = $groups;
return $this;
}
/**
* @return Collection<int, CustomerCertificates>
*/
// public function getCustomerCertificates(): Collection
// {
// return $this->customerCertificates;
// }
public function addCustomerCertificate(CustomerCertificates $customerCertificate): self
{
if (!$this->customerCertificates->contains($customerCertificate)) {
$this->customerCertificates[] = $customerCertificate;
$customerCertificate->setCertificate($this);
}
return $this;
}
public function removeCustomerCertificate(CustomerCertificates $customerCertificate): self
{
if ($this->customerCertificates->removeElement($customerCertificate)) {
// set the owning side to null (unless already changed)
if ($customerCertificate->getCertificate() === $this) {
$customerCertificate->setCertificate(null);
}
}
return $this;
}
/**
* @return Collection<int, ProjectStakeholders>
*/
// public function getProjectStakeholders(): Collection
// {
// return $this->projectStakeholders;
// }
public function addProjectStakeholder(ProjectStakeholders $projectStakeholder): self
{
if (!$this->projectStakeholders->contains($projectStakeholder)) {
$this->projectStakeholders[] = $projectStakeholder;
$projectStakeholder->addDependentCertificate($this);
}
return $this;
}
public function removeProjectStakeholder(ProjectStakeholders $projectStakeholder): self
{
if ($this->projectStakeholders->removeElement($projectStakeholder)) {
$projectStakeholder->removeDependentCertificate($this);
}
return $this;
}
/**
* @return Collection<int, Projects>
*/
// public function getProjects(): Collection
// {
// return $this->projects;
// }
public function addProject(Projects $project): self
{
if (!$this->projects->contains($project)) {
$this->projects[] = $project;
$project->addDependentCertificate($this);
}
return $this;
}
public function removeProject(Projects $project): self
{
if ($this->projects->removeElement($project)) {
$project->removeDependentCertificate($this);
}
return $this;
}
public function getCertificateEligibility(): ?CertificateEligibilities
{
return $this->certificate_eligibility;
}
public function setCertificateEligibility(?CertificateEligibilities $certificate_eligibility): self
{
$this->certificate_eligibility = $certificate_eligibility;
return $this;
}
}