- <?php
- namespace Slivki\Entity;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Slivki\Entity\Media\DirectorMapLogo;
- use Slivki\Entity\Media\DirectorOnlinePaymentLogoMedia;
- class Director extends Entity implements \JsonSerializable {
-     const LOGO_MEDIA_PATH = "/public/znijki-media/initial/default/1009921/";
-     const STATUS_ACTIVE = 0;
-     const STATUS_WAIT = 1;
-     const STATUS_DECLINE = 2;
-     const STATUS_LIST = ['Привлечен', 'Думает', 'Отказ'];
-     const MARSEL_DIRECTOR_ID = 2;
-     const SHAH_DIRECTOR_ID = 15073;
-     const OBLAKA_DIRECTOR_ID = 3771;
-     const WHITE_LOTUS_DIRECTOR_ID = 3771;
-     const DIRECTORS_WITH_BEPAID = [
-         self::MARSEL_DIRECTOR_ID,
-         self::SHAH_DIRECTOR_ID,
-         self::OBLAKA_DIRECTOR_ID,
-         self::WHITE_LOTUS_DIRECTOR_ID
-     ];
-     protected $domainObjectID;
-     protected $name;
-     protected $email;
-     protected $legalEntity;
-     protected $taxID;
-     protected $receiveLetters;
-     protected $offers;
-     protected $sales;
-     protected $manager;
-     protected $teaserLogoWidth;
-     protected $teaserLogoHeight;
-     protected $status;
-     protected ?Collection $mapLogo;
-     protected ?Collection $onlinePaymentLogo;
-     protected $punished;
-     protected $lastCodeNumber;
-     protected $about;
-     protected $createdOn;
-     protected $modifiedOn;
-     protected $extraEmails;
-     protected $phoneNumber;
-     protected $site;
-     protected $notes;
-     protected $legalAddress;
-     protected $accountNumber;
-     protected $pageOffer;
-     protected $taxRegistrationDate;
-     protected $tradeRegistrationDate;
-     protected $registrationAuthority;
-     protected $workingHours;
-     protected $legalEmail;
-     protected $footerInfo;
-     protected $infoPages;
-     protected $companyLink;
-     public function __construct() {
-         $this->offers = new ArrayCollection();
-         $this->sales = new ArrayCollection();
-         $this->createdOn = new \DateTime();
-         $this->modifiedOn = new \DateTime();
-         $this->notes = new ArrayCollection();
-         $this->infoPages = new ArrayCollection();
-         $this->mapLogo = new ArrayCollection();
-         $this->onlinePaymentLogo = new ArrayCollection();
-         $this->punished = false;
-     }
-     public function getName() {
-         return $this->name;
-     }
-     public function setName($name) {
-         $this->name = $name;
-     }
-     public function getDomainObjectID() {
-         return $this->domainObjectID;
-     }
-     public function setDomainObjectID($domainObjectID) {
-         $this->domainObjectID = $domainObjectID;
-     }
-     public function getEmail() {
-         return $this->email;
-     }
-     public function setEmail($email) {
-         $this->email = trim(mb_strtolower($email));
-     }
-     public function getLegalEntity() {
-         return $this->legalEntity;
-     }
-     public function setLegalEntity($legalEntity) {
-         $this->legalEntity = $legalEntity;
-     }
-     public function getTaxID (){
-         return $this->taxID;
-     }
-     public function setTaxID($taxID) {
-         $this->taxID = $taxID;
-     }
-     public function isReceiveLetters() {
-         return $this->receiveLetters;
-     }
-     public function setReceiveLetters($receiveLetters) {
-         $this->receiveLetters = $receiveLetters;
-     }
-     public function getTeaserLogoWidth() {
-         return $this->teaserLogoWidth;
-     }
-     public function setTeaserLogoWidth($teaserLogoWidth) {
-         $this->teaserLogoWidth = $teaserLogoWidth;
-     }
-     public function getTeaserLogoHeight() {
-         return $this->teaserLogoHeight;
-     }
-     public function setTeaserLogoHeight($teaserLogoHeight) {
-         $this->teaserLogoHeight = $teaserLogoHeight;
-     }
-     public function addOffer(Offer $offer) {
-         if (!$this->offers->contains($offer)) {
-             $this->offers->add($offer);
-         }
-     }
-     public function removeOffer(Offer $offer) {
-         $this->offers->removeElement($offer);
-     }
-     public function removeSale(Sale $sale) {
-         $this->sales->removeElement($sale);
-     }
-     public function addSale(Sale $offer) {
-         if (!$this->sales->contains($offer)) {
-             $this->sales->add($offer);
-         }
-     }
-     public function getOffers() {
-         return $this->offers;
-     }
-     /**
-      * @return array<Offer>
-      */
-     public function getActiveOffers(): array
-     {
-         return array_filter($this->offers->getValues(), static fn (Offer $offer): bool => $offer->isVisible());
-     }
-     public function getSales() {
-         return $this->sales;
-     }
-     public function getManager() {
-         return $this->manager;
-     }
-     public function setManager(User $manager) {
-         $this->manager = $manager;
-     }
-     public function getStatus() {
-         return $this->status;
-     }
-     public function setStatus($status) {
-         $this->status = $status;
-     }
-     public function getMapLogo(): ?DirectorMapLogo
-     {
-         return $this->mapLogo->count() > 0 ? $this->mapLogo->first() : null;
-     }
-     public function setMapLogo(DirectorMapLogo $mapLogo): void
-     {
-         $mapLogo->setDirector($this);
-         $this->mapLogo = new ArrayCollection([$mapLogo]);
-     }
-     public function getOnlinePaymentLogo(): ?DirectorOnlinePaymentLogoMedia
-     {
-         return $this->onlinePaymentLogo->count() > 0 ? $this->onlinePaymentLogo->first() : null;
-     }
-     public function setOnlinePaymentLogo(DirectorOnlinePaymentLogoMedia $onlinePaymentLogo): void
-     {
-         $onlinePaymentLogo->setDirector($this);
-         $this->onlinePaymentLogo = new ArrayCollection([$onlinePaymentLogo]);
-     }
-     public function getEntityIDList() {
-         $entityIDList = [];
-         foreach ($this->offers as $offer) {
-             $entityIDList[] = $offer->getID();
-         }
-         foreach ($this->sales as $sale) {
-             $entityIDList[] = $sale->getID();
-         }
-         return $entityIDList;
-     }
-     public function hasOffer($offerID) {
-         foreach ($this->offers as $offer) {
-              if ($offer->getID() == $offerID) {
-                  return true;
-              };
-         }
-         return false;
-     }
-     public function isPunished() {
-         return $this->punished;
-     }
-     public function setPunished($punished) {
-         $this->punished = $punished;
-     }
-     public function getLastCodeNumber() {
-         return $this->lastCodeNumber;
-     }
-     public function setLastCodeNumber($lastCodeNumber) {
-         $this->lastCodeNumber = $lastCodeNumber;
-     }
-     public function getAbout() {
-         return $this->about;
-     }
-     public function setAbout($about) {
-         $this->about = $about;
-     }
-     /** @return \DateTime */
-     public function getCreatedOn() {
-         return $this->createdOn;
-     }
-     public function setCreatedOn($createdOn) {
-         $this->createdOn = $createdOn;
-     }
-     /** @return \DateTime */
-     public function getModifiedOn() {
-         return $this->modifiedOn;
-     }
-     public function setModifiedOn($modifiedOn) {
-         $this->modifiedOn = $modifiedOn;
-     }
-     public function getExtraEmails() {
-         return $this->extraEmails;
-     }
-     public function setExtraEmails($extraEmails) {
-         $this->extraEmails = $extraEmails;
-     }
-     public function getPhoneNumber() {
-         return $this->phoneNumber;
-     }
-     public function setPhoneNumber($phoneNumber) {
-         $this->phoneNumber = $phoneNumber;
-     }
-     public function getSite() {
-         return $this->site;
-     }
-     public function setSite($site) {
-         $this->site = $site;
-     }
-     public function getTaxRegistrationDate() {
-         return $this->taxRegistrationDate;
-     }
-     public function setTaxRegistrationDate($taxRegistrationDate) {
-         $this->taxRegistrationDate = $taxRegistrationDate;
-     }
-     public function getTradeRegistrationDate() {
-         return $this->tradeRegistrationDate;
-     }
-     public function setTradeRegistrationDate($tradeRegistrationDate) {
-         $this->tradeRegistrationDate = $tradeRegistrationDate;
-     }
-     public function getRegistrationAuthority() {
-         return $this->registrationAuthority;
-     }
-     public function setRegistrationAuthority($registrationAuthority) {
-         $this->registrationAuthority = $registrationAuthority;
-     }
-     public function getWorkingHours() {
-         return $this->workingHours;
-     }
-     public function setWorkingHours($workingHours) {
-         $this->workingHours = $workingHours;
-     }
-     public function getLegalEmail() {
-         return $this->legalEmail;
-     }
-     public function setLegalEmail($legalEmail) {
-         $this->legalEmail = $legalEmail;
-     }
-     public function getFooterInfo() {
-         return $this->footerInfo;
-     }
-     public function setFooterInfo($footerInfo) {
-         $this->footerInfo = $footerInfo;
-     }
-     public function getInfoPages() {
-         return $this->infoPages;
-     }
-     public function addInfoPage(InfoPage $infoPage) {
-         if (!$this->infoPages->contains($infoPage)) {
-             $this->infoPages->add($infoPage);
-             $infoPage->setDirector($this);
-         }
-     }
-     /** @return ArrayCollection */
-     public function getNotes() {
-         return $this->notes;
-     }
-     public function addNote($note) {
-         if (!$this->notes->contains($note)) {
-             $this->notes->add($note);
-             $note->setSupplier($this);
-         }
-     }
-     public function getLegalAddress() {
-         return $this->legalAddress;
-     }
-     public function setLegalAddress($legalAddress) {
-         $this->legalAddress = $legalAddress;
-     }
-     public function getAccountNumber() {
-         return $this->accountNumber;
-     }
-     public function setAccountNumber($accountNumber) {
-         $this->accountNumber = $accountNumber;
-     }
-     /** @return Offer */
-     public function getPageOffer() {
-         return $this->pageOffer;
-     }
-     public function setPageOffer(Offer $pageOffer = null) {
-         $this->pageOffer = $pageOffer;
-     }
-     public function jsonSerialize(): array
-     {
-         return [
-             'ID' => $this->ID,
-             'email' => $this->email,
-             'legalEntity' => $this->legalEntity,
-             'receiveLetters' => $this->receiveLetters,
-             'about' => $this->about,
-         ];
-     }
-     public function getCompanyLink() {
-         return $this->companyLink;
-     }
-     public function setCompanyLink($companyLink) {
-         $this->companyLink = $companyLink;
-     }
- }