<?php
namespace App\Entity;
use App\Repository\NewsletterProspectPartnerRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @Vich\Uploadable
*/
#[ORM\Entity(repositoryClass: NewsletterProspectPartnerRepository::class)]
class NewsletterProspectPartner
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255)]
private $name;
#[ORM\Column(type: 'string', length: 255)]
private $title;
#[ORM\Column(type: 'datetime')]
private $updatedAt;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $logoName = null;
/**
* @Vich\UploadableField(mapping="newsletter_prospect_file", fileNameProperty="logoName")
* @var File
*/
private $logoFile;
#[ORM\Column(type: 'string', length: 255)]
private $avantage1;
#[ORM\Column(type: 'string', length: 255)]
private $avantage2;
#[ORM\Column(type: 'string', length: 255)]
private $avantage3;
#[ORM\Column(type: 'string', length: 255)]
private $avantage4;
#[ORM\Column(type: 'string', length: 255)]
private $avantage5;
#[ORM\Column(type: 'string', length: 255)]
private $avantage6;
#[ORM\OneToMany(mappedBy: 'partner', targetEntity: NewsletterProspect::class)]
private $newsletterProspect;
#[ORM\Column(type: 'string', length: 255)]
private $ctaLink;
public function __construct()
{
$this->newsletterProspect = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getAvantage1(): ?string
{
return $this->avantage1;
}
public function setAvantage1(string $avantage1): self
{
$this->avantage1 = $avantage1;
return $this;
}
public function getAvantage2(): ?string
{
return $this->avantage2;
}
public function setAvantage2(string $avantage2): self
{
$this->avantage2 = $avantage2;
return $this;
}
public function getAvantage3(): ?string
{
return $this->avantage3;
}
public function setAvantage3(string $avantage3): self
{
$this->avantage3 = $avantage3;
return $this;
}
public function getAvantage4(): ?string
{
return $this->avantage4;
}
public function setAvantage4(string $avantage4): self
{
$this->avantage4 = $avantage4;
return $this;
}
public function getAvantage5(): ?string
{
return $this->avantage5;
}
public function setAvantage5(string $avantage5): self
{
$this->avantage5 = $avantage5;
return $this;
}
public function getAvantage6(): ?string
{
return $this->avantage6;
}
public function setAvantage6(string $avantage6): self
{
$this->avantage6 = $avantage6;
return $this;
}
/**
* @return Collection<int, NewsletterProspect>
*/
public function getNewsletterProspect(): Collection
{
return $this->newsletterProspect;
}
public function addNewsletterProspect(NewsletterProspect $newsletterProspect): self
{
if (!$this->newsletterProspect->contains($newsletterProspect)) {
$this->newsletterProspect[] = $newsletterProspect;
$newsletterProspect->setPartner($this);
}
return $this;
}
public function removeNewsletterProspect(NewsletterProspect $newsletterProspect): self
{
if ($this->newsletterProspect->removeElement($newsletterProspect)) {
// set the owning side to null (unless already changed)
if ($newsletterProspect->getPartner() === $this) {
$newsletterProspect->setPartner(null);
}
}
return $this;
}
public function getLogoName(): ?string
{
return $this->logoName;
}
public function setLogoName(?string $logoName): self
{
$this->logoName = $logoName;
return $this;
}
public function setLogoFile(?File $file = null)
{
$this->logoFile = $file;
// VERY IMPORTANT:
// It is required that at least one field changes if you are using Doctrine,
// otherwise the event listeners won't be called and the file is lost
if ($file) {
// if 'updatedAt' is not defined in your entity, use another property
$this->updatedAt = new \DateTime('now');
}
}
public function getLogoFile()
{
return $this->logoFile;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getCtaLink(): ?string
{
return $this->ctaLink;
}
public function setCtaLink(string $ctaLink): self
{
$this->ctaLink = $ctaLink;
return $this;
}
}