src/Entity/Photo.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping\Index;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Repository\PhotoRepository;
  6. #[ORM\Entity(repositoryClassPhotoRepository::class)]
  7. #[Index(name"photo_parent"columns: ["type""par"])]
  8. #[Index(name"photo_visible"columns: ["visible"])]
  9. class Photo implements EntityInterface
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $type null;
  17.     #[ORM\Column]
  18.     private ?int $par null;
  19.     #[ORM\Column(length255)]
  20.     private ?string $name null;
  21.     #[ORM\Column]
  22.     private ?int $prior null;
  23.     #[ORM\Column]
  24.     private ?bool $visible null;
  25.     #[ORM\Column(length255)]
  26.     private ?string $pic '';
  27.     public function getId(): ?int
  28.     {
  29.         return $this->id;
  30.     }
  31.     public function getType(): ?string
  32.     {
  33.         return $this->type;
  34.     }
  35.     public function setType(string $type): self
  36.     {
  37.         $this->type $type;
  38.         return $this;
  39.     }
  40.     public function getPar(): ?int
  41.     {
  42.         return $this->par;
  43.     }
  44.     public function setPar(int $par): self
  45.     {
  46.         $this->par $par;
  47.         return $this;
  48.     }
  49.     public function getName(): ?string
  50.     {
  51.         return $this->name;
  52.     }
  53.     public function setName(string $name): self
  54.     {
  55.         $this->name $name;
  56.         return $this;
  57.     }
  58.     public function getPrior(): ?int
  59.     {
  60.         return $this->prior;
  61.     }
  62.     public function setPrior(int $prior): self
  63.     {
  64.         $this->prior $prior;
  65.         return $this;
  66.     }
  67.     public function isVisible(): ?bool
  68.     {
  69.         return $this->visible;
  70.     }
  71.     public function setVisible(bool $visible): self
  72.     {
  73.         $this->visible $visible;
  74.         return $this;
  75.     }
  76.     public function getPic(): ?string
  77.     {
  78.         return $this->pic;
  79.     }
  80.     public function setPic(string $pic): self
  81.     {
  82.         $this->pic $pic;
  83.         return $this;
  84.     }
  85.     public function getPicL(): string
  86.     {
  87.         return "/pic/photo-l/".$this->getPic();
  88.     }
  89.     public function getPicM(): string
  90.     {
  91.         return "/pic/photo-m/".$this->getPic();
  92.     }
  93.     public function getPicS(): string
  94.     {
  95.         return "/pic/photo-s/".$this->getPic();
  96.     }
  97.     public function getPicOriginal(): string
  98.     {
  99.         return "/pic/photo/".$this->getPic();
  100.     }
  101. }