src/Entity/Partners.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PartnersRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=PartnersRepository::class)
  8.  */
  9. class Partners
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=true)
  19.      */
  20.     private $name;
  21.     /**
  22.      * @ORM\OneToOne(targetEntity=Picture::class, cascade={"persist", "remove"})
  23.      */
  24.     private $logo;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true)
  27.      */
  28.     private $website;
  29.     /**
  30.      * @ORM\Column(type="boolean", nullable=true)
  31.      */
  32.     private $isEnabled;
  33.     /**
  34.      * @ORM\ManyToOne(targetEntity=Users::class)
  35.      */
  36.     private $user;
  37.     /**
  38.      * @ORM\Column(type="datetime", nullable=true)
  39.      */
  40.     private $createdAt;
  41.     /**
  42.      * @ORM\ManyToOne(targetEntity=PartnersCategories::class, inversedBy="partners")
  43.      */
  44.     private $category;
  45.     
  46.     /**
  47.      * @var string
  48.      *
  49.      * @ORM\Column(name="description", type="text", nullable=true)
  50.      */
  51.     private $description;
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getName(): ?string
  57.     {
  58.         return $this->name;
  59.     }
  60.     public function setName(?string $name): self
  61.     {
  62.         $this->name $name;
  63.         return $this;
  64.     }
  65.     public function getLogo(): ?Picture
  66.     {
  67.         return $this->logo;
  68.     }
  69.     public function setLogo(?Picture $logo): self
  70.     {
  71.         if($logo->getTarget()){
  72.             $this->logo $logo;
  73.             $this->logo->setDir('upload/images/partners');
  74.             $this->logo->setThumbnailDir('upload/thumbnails/partners');
  75.         }
  76.         return $this;
  77.     }
  78.     public function getWebsite(): ?string
  79.     {
  80.         return $this->website;
  81.     }
  82.     public function setWebsite(?string $website): self
  83.     {
  84.         $this->website $website;
  85.         return $this;
  86.     }
  87.     public function getIsEnabled(): ?bool
  88.     {
  89.         return $this->isEnabled;
  90.     }
  91.     public function setIsEnabled(?bool $isEnabled): self
  92.     {
  93.         $this->isEnabled $isEnabled;
  94.         return $this;
  95.     }
  96.     public function getUser(): ?Users
  97.     {
  98.         return $this->user;
  99.     }
  100.     public function setUser(?Users $user): self
  101.     {
  102.         $this->user $user;
  103.         return $this;
  104.     }
  105.     public function getCreatedAt(): ?\DateTimeInterface
  106.     {
  107.         return $this->createdAt;
  108.     }
  109.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  110.     {
  111.         $this->createdAt $createdAt;
  112.         return $this;
  113.     }
  114.     public function getCategory(): ?PartnersCategories
  115.     {
  116.         return $this->category;
  117.     }
  118.     public function setCategory(?PartnersCategories $category): self
  119.     {
  120.         $this->category $category;
  121.         return $this;
  122.     }
  123.     public function isIsEnabled(): ?bool
  124.     {
  125.         return $this->isEnabled;
  126.     }
  127.     public function getDescription(): ?string
  128.     {
  129.         return $this->description;
  130.     }
  131.     public function setDescription(?string $description): self
  132.     {
  133.         $this->description $description;
  134.         return $this;
  135.     }
  136. }