<?php
namespace App\Entity;
use App\Entity\OtherProvider\ContactPerson;
use App\Repository\OtherProviderRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=OtherProviderRepository::class)
*/
class OtherProvider
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="text")
*/
private $address;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $website;
/**
* @ORM\OneToMany(targetEntity=ContactPerson::class, mappedBy="otherProvider", cascade={"persist","remove"})
*/
private $contactPeople;
/**
* @ORM\Column(type="boolean")
*/
private $enabled;
public function __construct()
{
$this->contactPeople = 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 getAddress(): ?string
{
return $this->address;
}
public function setAddress(string $address): self
{
$this->address = $address;
return $this;
}
public function getWebsite(): ?string
{
return $this->website;
}
public function setWebsite(?string $website): self
{
$this->website = $website;
return $this;
}
/**
* @return Collection<int, ContactPerson>
*/
public function getContactPeople(): Collection
{
return $this->contactPeople;
}
public function addContactPerson(ContactPerson $contactPerson): self
{
if (!$this->contactPeople->contains($contactPerson)) {
$this->contactPeople[] = $contactPerson;
$contactPerson->setOtherProvider($this);
}
return $this;
}
public function removeContactPerson(ContactPerson $contactPerson): self
{
if ($this->contactPeople->removeElement($contactPerson)) {
// set the owning side to null (unless already changed)
if ($contactPerson->getOtherProvider() === $this) {
$contactPerson->setOtherProvider(null);
}
}
return $this;
}
public function isEnabled(): ?bool
{
return $this->enabled;
}
public function setEnabled(bool $enabled): self
{
$this->enabled = $enabled;
return $this;
}
}