<?php
namespace App\Entity;
use App\Repository\EnterpriseRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=EnterpriseRepository::class)
*/
class Enterprise
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $type;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="string", length=255, nullable =true)
*/
private $numImport;
/**
* @ORM\OneToOne(targetEntity=Location::class, cascade={"persist", "remove"})
* @ORM\JoinColumn(nullable=false)
*/
private $location;
/**
* @ORM\OneToMany(targetEntity=EnterpriseRequest::class, mappedBy="enterprise")
*/
private $enterpriseRequests;
/**
* @ORM\OneToMany(targetEntity=EnterpriseOptionSejourSession::class, mappedBy="enterprise")
*/
private $enterpriseOptionSejourSessions;
/**
* @ORM\OneToOne(targetEntity=Contact::class, inversedBy="enterprise", cascade={"persist", "remove"})
* @ORM\JoinColumn(nullable=false)
*/
private $contact;
/**
* @ORM\OneToMany(targetEntity=Reduction::class, mappedBy="enterprise")
*/
private $reductions;
/**
* @ORM\OneToMany(targetEntity=ContactComment::class, mappedBy="enterprise")
*/
private $contactComments;
public function __construct()
{
$this->enterpriseRequests = new ArrayCollection();
$this->enterpriseOptionSejourSessions = new ArrayCollection();
$this->reductions = new ArrayCollection();
$this->contactComments = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): self
{
$this->type = $type;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getNumImport(): ?string
{
return $this->numImport;
}
public function setNumImport(string $name): self
{
$this->numImport = $name;
return $this;
}
public function getLocation(): ?Location
{
return $this->location;
}
public function setLocation(Location $location): self
{
$this->location = $location;
return $this;
}
/**
* @return Collection|EnterpriseRequest[]
*/
public function getEnterpriseRequests(): Collection
{
return $this->enterpriseRequests;
}
public function addEnterpriseRequest(EnterpriseRequest $enterpriseRequest): self
{
if (!$this->enterpriseRequests->contains($enterpriseRequest)) {
$this->enterpriseRequests[] = $enterpriseRequest;
$enterpriseRequest->setEnterprise($this);
}
return $this;
}
public function removeEnterpriseRequest(EnterpriseRequest $enterpriseRequest): self
{
if ($this->enterpriseRequests->removeElement($enterpriseRequest)) {
// set the owning side to null (unless already changed)
if ($enterpriseRequest->getEnterprise() === $this) {
$enterpriseRequest->setEnterprise(null);
}
}
return $this;
}
/**
* @return Collection|EnterpriseOptionSejourSession[]
*/
public function getEnterpriseOptionSejourSessions(): Collection
{
return $this->enterpriseOptionSejourSessions;
}
public function addEnterpriseOptionSejourSession(EnterpriseOptionSejourSession $enterpriseOptionSejourSession): self
{
if (!$this->enterpriseOptionSejourSessions->contains($enterpriseOptionSejourSession)) {
$this->enterpriseOptionSejourSessions[] = $enterpriseOptionSejourSession;
$enterpriseOptionSejourSession->setEnterprise($this);
}
return $this;
}
public function removeEnterpriseOptionSejourSession(EnterpriseOptionSejourSession $enterpriseOptionSejourSession): self
{
if ($this->enterpriseOptionSejourSessions->removeElement($enterpriseOptionSejourSession)) {
// set the owning side to null (unless already changed)
if ($enterpriseOptionSejourSession->getEnterprise() === $this) {
$enterpriseOptionSejourSession->setEnterprise(null);
}
}
return $this;
}
public function getContact(): ?Contact
{
return $this->contact;
}
public function setContact(Contact $contact): self
{
$this->contact = $contact;
return $this;
}
/**
* @return Collection|Reduction[]
*/
public function getReductions(): Collection
{
return $this->reductions;
}
public function addReduction(Reduction $reduction): self
{
if (!$this->reductions->contains($reduction)) {
$this->reductions[] = $reduction;
$reduction->setEnterprise($this);
}
return $this;
}
public function removeReduction(Reduction $reduction): self
{
if ($this->reductions->removeElement($reduction)) {
// set the owning side to null (unless already changed)
if ($reduction->getEnterprise() === $this) {
$reduction->setEnterprise(null);
}
}
return $this;
}
/**
* @return Collection|ContactComment[]
*/
public function getContactComments(): Collection
{
return $this->contactComments;
}
public function addContactComment(ContactComment $contactComment): self
{
if (!$this->contactComments->contains($contactComment)) {
$this->contactComments[] = $contactComment;
$contactComment->setEnterprise($this);
}
return $this;
}
public function removeContactComment(ContactComment $contactComment): self
{
if ($this->contactComments->removeElement($contactComment)) {
// set the owning side to null (unless already changed)
if ($contactComment->getEnterprise() === $this) {
$contactComment->setEnterprise(null);
}
}
return $this;
}
}