src/Entity/Property.php line 14

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PropertyRepository;
  4. use App\Trait\SoftDeleteTrait;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassPropertyRepository::class)]
  10. #[ORM\Index(fields: ['isDeleted'])]
  11. class Property
  12. {
  13.     use SoftDeleteTrait;
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     private ?int $id null;
  18.     #[ORM\Column(length255)]
  19.     private ?string $name null;
  20.     #[ORM\Column(length255)]
  21.     private ?string $slug null;
  22.     #[ORM\ManyToOne(inversedBy'properties')]
  23.     #[ORM\JoinColumn(nullablefalse)]
  24.     private ?Whitelabel $whitelabel null;
  25.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  26.     private ?\DateTimeInterface $createDate null;
  27.     #[ORM\ManyToOne]
  28.     #[ORM\JoinColumn(nullablefalse)]
  29.     private ?User $creatorUser null;
  30.     #[ORM\Column(length255)]
  31.     private ?string $address null;
  32.     #[ORM\Column(length255)]
  33.     private ?string $phone null;
  34.     #[ORM\ManyToOne(inversedBy'properties')]
  35.     private ?City $city null;
  36.     #[ORM\Column(length255nullabletrue)]
  37.     private ?string $longtitude null;
  38.     #[ORM\Column(length255nullabletrue)]
  39.     private ?string $latitude null;
  40.     #[ORM\ManyToMany(targetEntityFile::class, inversedBy'properties')]
  41.     private Collection $files;
  42.     #[ORM\OneToMany(mappedBy'property'targetEntityMenu::class)]
  43.     private Collection $menus;
  44.     #[ORM\ManyToMany(targetEntityUser::class, mappedBy'properties')]
  45.     private Collection $users;
  46.     #[ORM\Column(length255nullabletrue)]
  47.     private ?string $email null;
  48.     #[ORM\Column(length255nullabletrue)]
  49.     private ?string $workingHours null;
  50.     #[ORM\Column]
  51.     private ?int $sort null;
  52.     public function __construct()
  53.     {
  54.         $this->files = new ArrayCollection();
  55.         $this->menus = new ArrayCollection();
  56.         $this->users = new ArrayCollection();
  57.     }
  58.     public function getId(): ?int
  59.     {
  60.         return $this->id;
  61.     }
  62.     public function __toString()
  63.     {
  64.         return $this->getName();
  65.     }
  66.     public function getName(): ?string
  67.     {
  68.         return $this->name;
  69.     }
  70.     public function setName(string $name): static
  71.     {
  72.         $this->name $name;
  73.         return $this;
  74.     }
  75.     public function getSlug(): ?string
  76.     {
  77.         return $this->slug;
  78.     }
  79.     public function setSlug(string $slug): static
  80.     {
  81.         $this->slug $slug;
  82.         return $this;
  83.     }
  84.     public function getWhitelabel(): ?Whitelabel
  85.     {
  86.         return $this->whitelabel;
  87.     }
  88.     public function setWhitelabel(?Whitelabel $whitelabel): self
  89.     {
  90.         $this->whitelabel $whitelabel;
  91.         return $this;
  92.     }
  93.     public function getCreateDate(): ?\DateTimeInterface
  94.     {
  95.         return $this->createDate;
  96.     }
  97.     public function setCreateDate(\DateTimeInterface $createDate): static
  98.     {
  99.         $this->createDate $createDate;
  100.         return $this;
  101.     }
  102.     public function getCreatorUser(): ?User
  103.     {
  104.         return $this->creatorUser;
  105.     }
  106.     public function setCreatorUser(?User $creatorUser): static
  107.     {
  108.         $this->creatorUser $creatorUser;
  109.         return $this;
  110.     }
  111.     public function getAddress(): ?string
  112.     {
  113.         return $this->address;
  114.     }
  115.     public function setAddress(string $address): static
  116.     {
  117.         $this->address $address;
  118.         return $this;
  119.     }
  120.     public function getPhone(): ?string
  121.     {
  122.         return $this->phone;
  123.     }
  124.     public function setPhone(string $phone): static
  125.     {
  126.         $this->phone $phone;
  127.         return $this;
  128.     }
  129.     public function getLongtitude(): ?string
  130.     {
  131.         return $this->longtitude;
  132.     }
  133.     public function setLongtitude(?string $longtitude): static
  134.     {
  135.         $this->longtitude $longtitude;
  136.         return $this;
  137.     }
  138.     public function getLatitude(): ?string
  139.     {
  140.         return $this->latitude;
  141.     }
  142.     public function setLatitude(?string $latitude): static
  143.     {
  144.         $this->latitude $latitude;
  145.         return $this;
  146.     }
  147.     public function getCity(): ?City
  148.     {
  149.         return $this->city;
  150.     }
  151.     public function setCity(?City $city): static
  152.     {
  153.         $this->city $city;
  154.         return $this;
  155.     }
  156.     /**
  157.      * @return Collection<int, File>
  158.      */
  159.     public function getFiles(): Collection
  160.     {
  161.         return $this->files;
  162.     }
  163.     public function addFile(File $file): static
  164.     {
  165.         if (!$this->files->contains($file)) {
  166.             $this->files->add($file);
  167.         }
  168.         return $this;
  169.     }
  170.     public function removeFile(File $file): static
  171.     {
  172.         $this->files->removeElement($file);
  173.         return $this;
  174.     }
  175.     /**
  176.      * @return Collection<int, Menu>
  177.      */
  178.     public function getMenus(): Collection
  179.     {
  180.         return $this->menus;
  181.     }
  182.     public function addMenu(Menu $menu): static
  183.     {
  184.         if (!$this->menus->contains($menu)) {
  185.             $this->menus->add($menu);
  186.         }
  187.         return $this;
  188.     }
  189.     public function removeMenu(Menu $menu): static
  190.     {
  191.         $this->menus->removeElement($menu);
  192.         return $this;
  193.     }
  194.     /**
  195.      * @return Collection<int, User>
  196.      */
  197.     public function getUsers(): Collection
  198.     {
  199.         return $this->users;
  200.     }
  201.     public function addUser(User $user): static
  202.     {
  203.         if (!$this->users->contains($user)) {
  204.             $this->users->add($user);
  205.             $user->addProperty($this);
  206.         }
  207.         return $this;
  208.     }
  209.     public function removeUser(User $user): static
  210.     {
  211.         if ($this->users->removeElement($user)) {
  212.             $user->removeProperty($this);
  213.         }
  214.         return $this;
  215.     }
  216.     public function getEmail(): ?string
  217.     {
  218.         return $this->email;
  219.     }
  220.     public function setEmail(?string $email): static
  221.     {
  222.         $this->email $email;
  223.         return $this;
  224.     }
  225.     public function getWorkingHours(): ?string
  226.     {
  227.         return $this->workingHours;
  228.     }
  229.     public function setWorkingHours(?string $workingHours): static
  230.     {
  231.         $this->workingHours $workingHours;
  232.         return $this;
  233.     }
  234.     public function getSort(): ?int
  235.     {
  236.         return $this->sort;
  237.     }
  238.     public function setSort(int $sort): static
  239.     {
  240.         $this->sort $sort;
  241.         return $this;
  242.     }
  243. }