src/Entity/Partner.php line 19
<?phpdeclare(strict_types=1);namespace App\Entity;use App\Entity\Mapped\NamedEntity;use App\Repository\PartnerRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: PartnerRepository::class)]#[ORM\Table(name: 'partner')]class Partner extends NamedEntity implements DocumentOwnerInterface{#[ORM\Column(name: 'address',type: 'string',length: 191,nullable: true)]private ?string $address = null;#[ORM\Column(name: 'place',type: 'string',length: 191,nullable: true)]private ?string $place = null;#[ORM\Column(name: 'contact',type: 'string',length: 191,nullable: true)]private ?string $contact = null;#[ORM\Column(name: 'oib',type: 'string',length: 191,nullable: true)]#[Assert\NotBlank(groups: ['action'])]private ?string $oib = null;#[ORM\Column(name: 'postal_code',type: 'integer',nullable: true)]private ?int $postalCode = null;#[ORM\Column(name: 'color',type: 'string',length: 191,nullable: true)]#[Assert\NotBlank(groups: ['action'])]#[Assert\Length(max: 100,groups: ['action'])]private ?string $color = null;#[ORM\ManyToOne(targetEntity: LegalEntity::class)]#[ORM\JoinColumn(name: 'legal_entity')]#[Assert\NotBlank(groups: ['action'])]private ?LegalEntity $legalEntity = null;#[ORM\ManyToOne(targetEntity: Institution::class)]#[ORM\JoinColumn(name: 'institution')]private ?Institution $institution = null;#[ORM\OneToMany(mappedBy: 'partner',targetEntity: PartnerDocument::class,cascade: ['persist'],fetch: 'EXTRA_LAZY',orphanRemoval: true)]#[Assert\Valid(groups: ['action'])]private iterable $document;#[ORM\OneToMany(mappedBy: 'partner',targetEntity: PartnerUser::class,cascade: ['persist'],fetch: 'EXTRA_LAZY',orphanRemoval: true)]#[Assert\Valid(groups: ['action'])]private iterable $externalPartners;public function __construct(){$this->document = new ArrayCollection();$this->externalPartners = new ArrayCollection();}public function getAddress(): ?string{return $this->address;}public function setAddress(?string $address): self{$this->address = $address;return $this;}public function getPlace(): ?string{return $this->place;}public function setPlace(?string $place): self{$this->place = $place;return $this;}public function getContact(): ?string{return $this->contact;}public function setContact(?string $contact): self{$this->contact = $contact;return $this;}public function getOib(): ?string{return $this->oib;}public function setOib(?string $oib): self{$this->oib = $oib;return $this;}public function getColor(): ?string{return $this->color;}public function setColor(?string $color): self{$this->color = $color;return $this;}public function getLegalEntity(): ?LegalEntity{return $this->legalEntity;}public function setLegalEntity(?LegalEntity $legalEntity): self{$this->legalEntity = $legalEntity;return $this;}public function getInstitution(): ?Institution{return $this->institution;}public function setInstitution(?Institution $institution): self{$this->institution = $institution;return $this;}public function getPostalCode(): ?int{return $this->postalCode;}public function setPostalCode(?int $postalCode): self{$this->postalCode = $postalCode;return $this;}public function getDocument(): iterable{return $this->document;}public function addDocument(DocumentInterface $document): void{if ($this->document->contains($document)) {return;}$this->document[] = $document;$document->setInstitution($this);}public function removeDocument(DocumentInterface $document): void{if (!$this->document->contains($document)) {return;}$this->document->removeElement($document);$document->setInstitution(null);}public function getExternalPartners(): iterable{return $this->externalPartners;}public function addExternalPartner(PartnerUser $externalPartner): void{if ($this->externalPartners->contains($externalPartner)) {return;}$this->externalPartners[] = $externalPartner;$externalPartner->setPartner($this);}public function removeExternalPartner(PartnerUser $externalPartner): void{if (!$this->externalPartners->contains($externalPartner)) {return;}$this->externalPartners->removeElement($externalPartner);$externalPartner->setPartner(null);}}