src/Entity/Whitelabel.php line 16
<?phpnamespace App\Entity;use App\Interface\SoftDeleteInterface;use App\Repository\WhitelabelRepository;use App\Trait\SoftDeleteTrait;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;use Symfony\Component\Uid\Uuid;#[ORM\Entity(repositoryClass: WhitelabelRepository::class)]class Whitelabel implements SoftDeleteInterface{use SoftDeleteTrait;#[ORM\Id]#[ORM\Column(type: 'uuid', unique: true)]#[Groups(['BASE'])]private ?string $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(length: 255)]private ?string $domain = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?\DateTimeInterface $createDate = null;#[ORM\OneToMany(mappedBy: 'whitelabel', targetEntity: Product::class, orphanRemoval: true)]private Collection $products;#[ORM\OneToMany(mappedBy: 'whitelabel', targetEntity: Component::class, orphanRemoval: true)]private Collection $components;#[ORM\OneToMany(mappedBy: 'whitelabel', targetEntity: Menu::class)]private Collection $menus;#[ORM\OneToMany(mappedBy: 'whitelabel', targetEntity: Property::class)]private Collection $properties;#[ORM\Column(length: 255, nullable: true)]private ?string $phone = null;#[ORM\Column(length: 2000, nullable: true)]private ?string $address = null;#[ORM\OneToMany(mappedBy: 'whitelabel', targetEntity: User::class, orphanRemoval: true)]private Collection $users;#[ORM\OneToMany(mappedBy: 'whitelabel', targetEntity: ProductCategory::class)]private Collection $productCategories;#[ORM\OneToMany(mappedBy: 'whitelabel', targetEntity: Allergen::class)]private Collection $allergens;#[ORM\OneToMany(mappedBy: 'whitelabel', targetEntity: WhitelabelDomain::class, orphanRemoval: true)]private Collection $whitelabelDomains;#[ORM\Column(length: 255, nullable: true)]private ?string $template = null;#[ORM\Column(length: 255, nullable: true)]private ?string $oneSignalApiId = null;#[ORM\Column(length: 255, nullable: true)]private ?string $oneSignalApiKey = null;public function __construct(){$this->id = Uuid::v4();$this->products = new ArrayCollection();$this->components = new ArrayCollection();$this->menus = new ArrayCollection();$this->properties = new ArrayCollection();$this->users = new ArrayCollection();$this->productCategories = new ArrayCollection();$this->allergens = new ArrayCollection();$this->whitelabelDomains = new ArrayCollection();}public function getId(): ?string{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(string $name): self{$this->name = $name;return $this;}public function getDomain(): ?string{return $this->domain;}public function setDomain(string $domain): self{$this->domain = $domain;return $this;}public function getCreateDate(): ?\DateTimeInterface{return $this->createDate;}public function setCreateDate(\DateTimeInterface $createDate): self{$this->createDate = $createDate;return $this;}/*** @return Collection<int, Product>*/public function getProducts(): Collection{return $this->products;}public function addProduct(Product $product): self{if (!$this->products->contains($product)) {$this->products->add($product);$product->setWhitelabel($this);}return $this;}public function removeProduct(Product $product): self{if ($this->products->removeElement($product)) {// set the owning side to null (unless already changed)if ($product->getWhitelabel() === $this) {$product->setWhitelabel(null);}}return $this;}/*** @return Collection<int, Component>*/public function getComponents(): Collection{return $this->components;}public function addComponent(Component $component): self{if (!$this->components->contains($component)) {$this->components->add($component);$component->setWhitelabel($this);}return $this;}public function removeComponent(Component $component): self{if ($this->components->removeElement($component)) {// set the owning side to null (unless already changed)if ($component->getWhitelabel() === $this) {$component->setWhitelabel(null);}}return $this;}/*** @return Collection<int, Menu>*/public function getMenus(): Collection{return $this->menus;}public function addMenu(Menu $menu): self{if (!$this->menus->contains($menu)) {$this->menus->add($menu);$menu->setWhitelabel($this);}return $this;}public function removeMenu(Menu $menu): self{if ($this->menus->removeElement($menu)) {// set the owning side to null (unless already changed)if ($menu->getWhitelabel() === $this) {$menu->setWhitelabel(null);}}return $this;}/*** @return Collection<int, Property>*/public function getProperties(): Collection{return $this->properties;}public function addProperty(Property $property): self{if (!$this->properties->contains($property)) {$this->properties->add($property);$property->setWhitelabel($this);}return $this;}public function removeProperty(Property $property): self{if ($this->properties->removeElement($property)) {// set the owning side to null (unless already changed)if ($property->getWhitelabel() === $this) {$property->setWhitelabel(null);}}return $this;}public function getPhone(): ?string{return $this->phone;}public function setPhone(?string $phone): self{$this->phone = $phone;return $this;}public function getAddress(): ?string{return $this->address;}public function setAddress(?string $address): self{$this->address = $address;return $this;}/*** @return Collection<int, User>*/public function getUsers(): Collection{return $this->users;}public function addUser(User $user): self{if (!$this->users->contains($user)) {$this->users->add($user);$user->setWhitelabel($this);}return $this;}public function removeUser(User $user): self{if ($this->users->removeElement($user)) {// set the owning side to null (unless already changed)if ($user->getWhitelabel() === $this) {$user->setWhitelabel(null);}}return $this;}/*** @return Collection<int, ProductCategory>*/public function getProductCategories(): Collection{return $this->productCategories;}public function addProductCategory(ProductCategory $productCategory): self{if (!$this->productCategories->contains($productCategory)) {$this->productCategories->add($productCategory);$productCategory->setWhitelabel($this);}return $this;}public function removeProductCategory(ProductCategory $productCategory): self{if ($this->productCategories->removeElement($productCategory)) {// set the owning side to null (unless already changed)if ($productCategory->getWhitelabel() === $this) {$productCategory->setWhitelabel(null);}}return $this;}/*** @return Collection<int, Allergen>*/public function getAllergens(): Collection{return $this->allergens;}public function addAllergen(Allergen $allergen): self{if (!$this->allergens->contains($allergen)) {$this->allergens->add($allergen);$allergen->setWhitelabel($this);}return $this;}public function removeAllergen(Allergen $allergen): self{if ($this->allergens->removeElement($allergen)) {// set the owning side to null (unless already changed)if ($allergen->getWhitelabel() === $this) {$allergen->setWhitelabel(null);}}return $this;}/*** @return Collection<int, WhitelabelDomain>*/public function getWhitelabelDomains(): Collection{return $this->whitelabelDomains;}public function addWhitelabelDomain(WhitelabelDomain $whitelabelDomain): static{if (!$this->whitelabelDomains->contains($whitelabelDomain)) {$this->whitelabelDomains->add($whitelabelDomain);$whitelabelDomain->setWhitelabel($this);}return $this;}public function removeWhitelabelDomain(WhitelabelDomain $whitelabelDomain): static{if ($this->whitelabelDomains->removeElement($whitelabelDomain)) {// set the owning side to null (unless already changed)if ($whitelabelDomain->getWhitelabel() === $this) {$whitelabelDomain->setWhitelabel(null);}}return $this;}public function getTemplate(): ?string{return $this->template;}public function setTemplate(?string $template): static{$this->template = $template;return $this;}public function getOneSignalApiId(): ?string{return $this->oneSignalApiId;}public function setOneSignalApiId(?string $oneSignalApiId): static{$this->oneSignalApiId = $oneSignalApiId;return $this;}public function getOneSignalApiKey(): ?string{return $this->oneSignalApiKey;}public function setOneSignalApiKey(?string $oneSignalApiKey): static{$this->oneSignalApiKey = $oneSignalApiKey;return $this;}}