src/Entity/BranchOffice.php line 15
<?phpnamespace App\Entity;use App\Repository\BranchOfficeRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;use Symfony\Component\String\Slugger\SluggerInterface;#[ORM\Entity(repositoryClass: BranchOfficeRepository::class)]#[UniqueEntity('slug')]class BranchOffice{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(length: 255, nullable: true)]private ?string $title = null;#[ORM\Column(length: 255, nullable: true)]private ?string $address = null;#[ORM\Column(length: 255, nullable: true)]private ?string $phoneNumber = null;#[ORM\Column(length: 255, nullable: true)]private ?string $color = null;#[ORM\Column(length: 255, nullable: true)]private ?string $vkLink = null;#[ORM\Column(length: 255, nullable: true)]private ?string $whatsappLink = null;#[ORM\Column(length: 255, nullable: true)]private ?string $instLink = null;#[ORM\Column(type: 'string', length: 255, unique: true)]private ?string $slug = null;#[ORM\Column(length: 255)]private ?string $backgroundImageUrl = null;#[ORM\OneToMany(mappedBy: 'branchOffice', targetEntity: Album::class, cascade: ['remove'])]private Collection $albums;#[ORM\OneToMany(mappedBy: 'branchOffice', targetEntity: MenuCard::class, orphanRemoval: true, cascade: ['persist'])]private Collection $menuCards;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $widgetFlamp = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $widget2gis = null;public function __construct(){$this->albums = new ArrayCollection();$this->menuCards = new ArrayCollection();}public function __toString(): string{return $this->name;}public function computeSlug(SluggerInterface $slugger){if (!$this->slug || '-' == $this->slug) {$this->slug = (string) $slugger->slug((string) $this->getName())->lower();}}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 getTitle(): ?string{return $this->title;}public function setTitle(?string $title): self{$this->title = $title;return $this;}public function getAddress(): ?string{return $this->address;}public function setAddress(?string $address): self{$this->address = $address;return $this;}public function getPhoneNumber(): ?string{return $this->phoneNumber;}public function setPhoneNumber(?string $phoneNumber): self{$this->phoneNumber = $phoneNumber;return $this;}public function getColor(): ?string{return $this->color;}public function setColor(?string $color): self{$this->color = $color;return $this;}public function getVkLink(): ?string{return $this->vkLink;}public function setVkLink(?string $vkLink): self{$this->vkLink = $vkLink;return $this;}public function getWhatsappLink(): ?string{return $this->whatsappLink;}public function setWhatsappLink(?string $whatsappLink): self{$this->whatsappLink = $whatsappLink;return $this;}public function getInstLink(): ?string{return $this->instLink;}public function setInstLink(?string $instLink): self{$this->instLink = $instLink;return $this;}public function getSlug(): ?string{return $this->slug;}public function setSlug(string $slug): self{$this->slug = $slug;return $this;}public function getBackgroundImageUrl(): ?string{return $this->backgroundImageUrl;}public function setBackgroundImageUrl(string $backgroundImageUrl): self{$this->backgroundImageUrl = $backgroundImageUrl;return $this;}/*** @return Collection<int, Album>*/public function getAlbums(): Collection{return $this->albums;}public function addAlbum(Album $album): self{if (!$this->albums->contains($album)) {$this->albums->add($album);$album->setBranchOffice($this);}return $this;}public function removeAlbum(Album $album): self{if ($this->albums->removeElement($album)) {if ($album->getBranchOffice() === $this) {$album->setBranchOffice(null);}}return $this;}/*** @return Collection<int, MenuCard>*/public function getMenuCards(): Collection{return $this->menuCards;}public function addMenuCard(MenuCard $menuCard): self{if (!$this->menuCards->contains($menuCard)) {$this->menuCards->add($menuCard);$menuCard->setBranchOffice($this);}return $this;}public function removeMenuCard(MenuCard $menuCard): self{if ($this->menuCards->removeElement($menuCard)) {if ($menuCard->getBranchOffice() === $this) {$menuCard->setBranchOffice(null);}}return $this;}public function getWidgetFlamp(): ?string{return $this->widgetFlamp;}public function setWidgetFlamp(?string $widgetFlamp): self{$this->widgetFlamp = $widgetFlamp;return $this;}public function getWidget2gis(): ?string{return $this->widget2gis;}public function setWidget2gis(?string $widget2gis): self{$this->widget2gis = $widget2gis;return $this;}}