src/Entity/Structure.php line 26
<?phpnamespace App\Entity;use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;use ApiPlatform\Metadata\ApiFilter;use ApiPlatform\Metadata\ApiResource;use App\Repository\StructureRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;use Vich\UploaderBundle\Mapping\Annotation as Vich;#[ORM\Entity(repositoryClass: StructureRepository::class)]#[ApiResource(normalizationContext: ['groups' => ['read']],denormalizationContext: ['groups' => ['write']],mercure: true,)]#[Vich\Uploadable]class Structure{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]#[Groups(['read'])]private ?int $id = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['read', 'write'])]private ?string $denomSociale = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['read', 'write'])]private ?string $adresse = null;#[ORM\Column(length: 10, nullable: true)]#[Groups(['read', 'write'])]private ?string $codePostal = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['read', 'write'])]private ?string $ville = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['read', 'write'])]private ?string $siteWeb = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['read', 'write'])]private ?string $apiKey = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['read', 'write'])]private ?string $mail = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['read', 'write'])]private ?string $telephone = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['read', 'write'])]private ?string $ftpHost = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['read', 'write'])]private ?string $ftpUser = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['read', 'write'])]private ?string $ftpPass = null;#[ORM\Column(nullable: true)]#[Groups(['read', 'write'])]private ?string $ftpPort = null;#[ORM\ManyToMany(targetEntity: User::class, mappedBy: 'structures')]#[ApiFilter(SearchFilter::class, strategy: 'exact')]#[Groups(['read'])]private Collection $users;#[ORM\ManyToOne(cascade: ['persist'])]private ?MediaObject $logo = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['read', 'write'])]private ?string $smtpHost = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['read', 'write'])]private ?string $smtpPort = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['read', 'write'])]private ?string $smtpUser = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['read', 'write'])]private ?string $smtpPass = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['read', 'write'])]private ?string $smtpEncryption = null;#[ORM\Column(nullable: true)]#[Groups(['read', 'write'])]private ?bool $multi = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['read', 'write'])]private ?string $urlGamsys = null;#[ORM\Column(nullable: true)]#[Groups(['read', 'write'])]private ?string $gamsysId = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['read', 'write'])]private ?string $ftpFolder = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['read', 'write'])]private ?string $ftpType = null;public function __construct(){$this->users = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getDenomSociale(): ?string{return $this->denomSociale;}public function setDenomSociale(?string $denomSociale): static{$this->denomSociale = $denomSociale;return $this;}public function getAdresse(): ?string{return $this->adresse;}public function setAdresse(?string $adresse): static{$this->adresse = $adresse;return $this;}public function getCodePostal(): ?string{return $this->codePostal;}public function setCodePostal(?string $codePostal): static{$this->codePostal = $codePostal;return $this;}public function getVille(): ?string{return $this->ville;}public function setVille(?string $ville): static{$this->ville = $ville;return $this;}public function getSiteWeb(): ?string{return $this->siteWeb;}public function setSiteWeb(?string $siteWeb): static{$this->siteWeb = $siteWeb;return $this;}public function getApiKey(): ?string{return $this->apiKey;}public function setApiKey(?string $apiKey): static{$this->apiKey = $apiKey;return $this;}public function getMail(): ?string{return $this->mail;}public function setMail(?string $mail): static{$this->mail = $mail;return $this;}public function getTelephone(): ?string{return $this->telephone;}public function setTelephone(?string $telephone): static{$this->telephone = $telephone;return $this;}/*** @return Collection<int, User>*/public function getUsers(): Collection{return $this->users;}public function addUser(User $user): static{if (!$this->users->contains($user)) {$this->users->add($user);$user->addStructure($this);}return $this;}public function removeUser(User $user): static{if ($this->users->removeElement($user)) {$user->removeStructure($this);}return $this;}public function getAbreviation (): string{$denom = strtoupper($this->getDenomSociale());$size = str_word_count($denom);$abr = "";if ($size > 1) {$words = explode(' ', $denom);foreach ($words as $word) {$abr .= $word[0];}} else {$abr = substr($denom, 0, 3);}return $abr;}public function getLogo(): ?MediaObject{return $this->logo;}public function setLogo(?MediaObject $logo): static{$this->logo = $logo;return $this;}#[Groups(['read'])]public function getLogoPath(): string{if ($this->getLogo()) {return $this->getLogo()->getFullPath();}return "";}public function getFtpHost(): ?string{return $this->ftpHost;}public function setFtpHost(?string $ftp_host): static{$this->ftpHost = $ftp_host;return $this;}public function getFtpUser(): ?string{return $this->ftpUser;}public function setFtpUser(?string $ftp_user): static{$this->ftpUser = $ftp_user;return $this;}public function getFtpPass(): ?string{return $this->ftpPass;}public function setFtpPass(?string $ftp_pass): static{$this->ftpPass = $ftp_pass;return $this;}public function getFtpPort(): ?string{return $this->ftpPort;}public function setFtpPort(?string $ftp_port): static{$this->ftpPort = $ftp_port;return $this;}public function getSmtpHost(): ?string{return $this->smtpHost;}public function setSmtpHost(?string $smtpHost): static{$this->smtpHost = $smtpHost;return $this;}public function getSmtpPort(): ?string{return $this->smtpPort;}public function setSmtpPort(?string $smtpPort): static{$this->smtpPort = $smtpPort;return $this;}public function getSmtpUser(): ?string{return $this->smtpUser;}public function setSmtpUser(?string $smtpUser): static{$this->smtpUser = $smtpUser;return $this;}public function getSmtpPass(): ?string{return $this->smtpPass;}public function setSmtpPass(?string $smtpPass): static{$this->smtpPass = $smtpPass;return $this;}public function getSmtpEncryption(): ?string{return $this->smtpEncryption;}public function setSmtpEncryption(?string $smtpEncryption): static{$this->smtpEncryption = $smtpEncryption;return $this;}public function isMulti(): ?bool{return $this->multi;}public function setMulti(?bool $multi): static{$this->multi = $multi;return $this;}public function getUrlGamsys(): ?string{return $this->urlGamsys;}public function setUrlGamsys(?string $urlGamsys): static{$this->urlGamsys = $urlGamsys;return $this;}public function getGamsysId(): ?string{return $this->gamsysId;}public function setGamsysId(?string $gamsysId): static{$this->gamsysId = $gamsysId;return $this;}public function getFtpFolder(): ?string{return $this->ftpFolder;}public function setFtpFolder(?string $ftpFolder): static{$this->ftpFolder = $ftpFolder;return $this;}public function getFtpType(): ?string{return $this->ftpType;}public function setFtpType(?string $ftpType): static{$this->ftpType = $ftpType;return $this;}}