src/Entity/File.php line 16
<?phpnamespace App\Entity;use App\Repository\FileRepository;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: FileRepository::class)]#[ORM\Index(fields: ['isDeleted'])]class File{use SoftDeleteTrait;#[ORM\Id]#[ORM\Column(type: 'uuid', unique: true)]#[Groups(['BASE'])]private ?string $id = null;#[ORM\ManyToOne]#[ORM\JoinColumn(nullable: false)]private ?Whitelabel $whitelabel = null;#[ORM\ManyToOne]#[ORM\JoinColumn(nullable: false)]private ?User $creatorUser = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(length: 255)]private ?string $path = null;#[ORM\Column]private ?int $size = null;#[ORM\Column(length: 255)]private ?string $md5 = null;#[ORM\Column(length: 255)]private ?string $mimeType = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?\DateTimeInterface $createDate = null;#[ORM\ManyToMany(targetEntity: Property::class, mappedBy: 'files')]private Collection $properties;#[ORM\ManyToMany(targetEntity: Menu::class, mappedBy: 'files')]private Collection $menus;#[ORM\Column]private ?int $sort = null;public function __construct(){$this->id = Uuid::v4();$this->properties = new ArrayCollection();$this->menus = new ArrayCollection();}public function __toString(){return $this->getName();}public function getId(): ?string{return $this->id;}public function getWhitelabel(): ?Whitelabel{return $this->whitelabel;}public function setWhitelabel(?Whitelabel $whitelabel): static{$this->whitelabel = $whitelabel;return $this;}public function getCreatorUser(): ?User{return $this->creatorUser;}public function setCreatorUser(?User $creatorUser): static{$this->creatorUser = $creatorUser;return $this;}public function getName(): ?string{return $this->name;}public function setName(string $name): static{$this->name = $name;return $this;}public function getPath(): ?string{return $this->path;}public function setPath(string $path): static{$this->path = $path;return $this;}public function getSize(): ?int{return $this->size;}public function setSize(int $size): static{$this->size = $size;return $this;}public function getMd5(): ?string{return $this->md5;}public function setMd5(string $md5): static{$this->md5 = $md5;return $this;}public function getMimeType(): ?string{return $this->mimeType;}public function setMimeType(string $mimeType): static{$this->mimeType = $mimeType;return $this;}public function getCreateDate(): ?\DateTimeInterface{return $this->createDate;}public function setCreateDate(\DateTimeInterface $createDate): static{$this->createDate = $createDate;return $this;}/*** @return Collection<int, Property>*/public function getProperties(): Collection{return $this->properties;}public function addProperty(Property $property): static{if (!$this->properties->contains($property)) {$this->properties->add($property);$property->addFile($this);}return $this;}public function removeProperty(Property $property): static{if ($this->properties->removeElement($property)) {$property->removeFile($this);}return $this;}/*** @return Collection<int, Menu>*/public function getMenus(): Collection{return $this->menus;}public function addMenu(Menu $menu): static{if (!$this->menus->contains($menu)) {$this->menus->add($menu);$menu->addFile($this);}return $this;}public function removeMenu(Menu $menu): static{if ($this->menus->removeElement($menu)) {$menu->removeFile($this);}return $this;}public function getSort(): ?int{return $this->sort;}public function setSort(int $sort): static{$this->sort = $sort;return $this;}}