src/Entity/UsefulLink.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UsefulLinkRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\HttpFoundation\File\File;
  6. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  7. /**
  8.  * @Vich\Uploadable
  9.  */
  10. #[ORM\Entity(repositoryClassUsefulLinkRepository::class)]
  11. class UsefulLink
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column(type'integer')]
  16.     private $id;
  17.     #[ORM\ManyToOne(targetEntityAccountingFirm::class, inversedBy'usefulLinks')]
  18.     #[ORM\JoinColumn(nullablefalse)]
  19.     private $accountingFirm;
  20.     #[ORM\Column(type'string'length255)]
  21.     private $link;
  22.     #[ORM\Column(type'string'length255)]
  23.     private $logo;
  24.     /**
  25.      * @Vich\UploadableField(mapping="photos", fileNameProperty="logo")
  26.      * @var File|null
  27.      */
  28.     private $tmpLogo null;
  29.     #[ORM\Column(type'datetime'nullabletrue)]
  30.     private $updatedAt;
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getAccountingFirm(): ?AccountingFirm
  36.     {
  37.         return $this->accountingFirm;
  38.     }
  39.     public function setAccountingFirm(?AccountingFirm $accountingFirm): self
  40.     {
  41.         $this->accountingFirm $accountingFirm;
  42.         return $this;
  43.     }
  44.     public function getLink(): ?string
  45.     {
  46.         return $this->link;
  47.     }
  48.     public function setLink(string $link): self
  49.     {
  50.         $this->link $link;
  51.         return $this;
  52.     }
  53.     public function getLogo(): ?string
  54.     {
  55.         return $this->logo;
  56.     }
  57.     public function setLogo(?string $logo): self
  58.     {
  59.         $this->logo $logo;
  60.         return $this;
  61.     }
  62.     public function setTmpLogo(?File $tmpLogo null): void
  63.     {
  64.         $this->tmpLogo $tmpLogo;
  65.         $this->updatedAt = new \DateTime('now');
  66.     }
  67.     public function getTmpLogo() : ?File
  68.     {
  69.         return $this->tmpLogo;
  70.     }
  71.     public function getUpdatedAt(): ?\DateTimeInterface
  72.     {
  73.         return $this->updatedAt;
  74.     }
  75.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  76.     {
  77.         $this->updatedAt $updatedAt;
  78.         return $this;
  79.     }
  80. }