src/Entity/CoregistrationCampaign.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CoregistrationCampaignRepository;
  4. use DateTime;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\HttpFoundation\File\File;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  10. /**
  11.  * @ORM\Entity(repositoryClass=CoregistrationCampaignRepository::class)
  12.  * @Vich\Uploadable
  13.  */
  14. class CoregistrationCampaign
  15. {
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private int $id;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private string $name;
  26.     /**
  27.      * @ORM\Column(type="text", nullable=true)
  28.      */
  29.     private ?string $description;
  30.     /**
  31.      * @ORM\Column(type="integer")
  32.      */
  33.     private int $mediaoptinCampaignId;
  34.     /**
  35.      * @ORM\Column(type="text", nullable=true)
  36.      */
  37.     private ?string $criteriaAge;
  38.     /**
  39.      * @ORM\Column(type="text", nullable=true)
  40.      */
  41.     private ?string $criteriaZipCode;
  42.     /**
  43.      * @ORM\Column(type="boolean")
  44.      */
  45.     private bool $enabled;
  46.     /**
  47.      * @ORM\Column(type="string", length=255)
  48.      */
  49.     private string $advertiserName;
  50.     /**
  51.      * @ORM\Column(type="string", length=255, nullable=true)
  52.      */
  53.     private ?string $advertiserLogoPath=null;
  54.     /**
  55.      * @assert\File( mimeTypes = {"image/jpeg", "image/png", "image/gif", "image/jpg","image/webp"})
  56.      * @Vich\UploadableField(mapping="coregistration_campaign_advertiser_logo", fileNameProperty="advertiserLogoPath")
  57.      * @var File
  58.      */
  59.     private $advertiserLogoFile;
  60.     /**
  61.      * @ORM\Column(type="datetime", nullable=true)
  62.      * @Gedmo\Timestampable(on="update")
  63.      */
  64.     private DateTime  $updatedAt;
  65.     public function getId(): ?int
  66.     {
  67.         return $this->id;
  68.     }
  69.     public function getName(): ?string
  70.     {
  71.         return $this->name;
  72.     }
  73.     public function setName(string $name): self
  74.     {
  75.         $this->name $name;
  76.         return $this;
  77.     }
  78.     public function getDescription(): ?string
  79.     {
  80.         return $this->description;
  81.     }
  82.     public function setDescription(string $description): self
  83.     {
  84.         $this->description $description;
  85.         return $this;
  86.     }
  87.     public function getMediaoptinCampaignId(): ?int
  88.     {
  89.         return $this->mediaoptinCampaignId;
  90.     }
  91.     public function setMediaoptinCampaignId(int $mediaoptinCampaignId): self
  92.     {
  93.         $this->mediaoptinCampaignId $mediaoptinCampaignId;
  94.         return $this;
  95.     }
  96.     public function getCriteriaAge(): ?string
  97.     {
  98.         return $this->criteriaAge;
  99.     }
  100.     public function setCriteriaAge(?string $criteriaAge): self
  101.     {
  102.         $this->criteriaAge $criteriaAge;
  103.         return $this;
  104.     }
  105.     public function getCriteriaZipCode(): ?string
  106.     {
  107.         return $this->criteriaZipCode;
  108.     }
  109.     public function setCriteriaZipCode(?string $criteriaZipCode): self
  110.     {
  111.         $this->criteriaZipCode $criteriaZipCode;
  112.         return $this;
  113.     }
  114.     public function isEnabled(): ?bool
  115.     {
  116.         return $this->enabled;
  117.     }
  118.     public function setEnabled(bool $enabled): self
  119.     {
  120.         $this->enabled $enabled;
  121.         return $this;
  122.     }
  123.     public function getAdvertiserName(): ?string
  124.     {
  125.         return $this->advertiserName;
  126.     }
  127.     public function setAdvertiserName(string $advertiserName): self
  128.     {
  129.         $this->advertiserName $advertiserName;
  130.         return $this;
  131.     }
  132.     public function getAdvertiserLogoPath(): ?string
  133.     {
  134.         return $this->advertiserLogoPath;
  135.     }
  136.     public function setAdvertiserLogoPath(?string $logoPath): self
  137.     {
  138.         $this->advertiserLogoPath $logoPath;
  139.         return $this;
  140.     }
  141.     public function setAdvertiserLogoFile(File $logoPath null)
  142.     {
  143.         $this->advertiserLogoFile $logoPath;
  144.         if($logoPath){
  145.             $this->updatedAt = new DateTime('now');
  146.         }
  147.     }
  148.     public function getAdvertiserLogoFile(): ?File
  149.     {
  150.         return $this->advertiserLogoFile;
  151.     }
  152. }