<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\HttpFoundation\File\File;
/**
* @ORM\Entity(repositoryClass="App\Repository\NewsletterRepository")
*/
class Newsletter
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User")
*/
private $user;
/**
* @ORM\Column(type="string", length=255)
*/
private $objet;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $type;
/**
* @ORM\Column(type="string")
*/
private $image;
/**
* @ORM\Column(type="datetime")
*/
private $create_at;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $update_at;
/**
* @ORM\Column(type="string")
*/
private $mode;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Service", inversedBy="newsletter")
*/
private $service;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $date_envoi;
function __construct()
{
$this->create_at= new \DateTime('UTC');
$this->service = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getObjet(): ?string
{
return $this->objet;
}
public function setObjet(string $objet): self
{
$this->objet = $objet;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): self
{
$this->type = $type;
return $this;
}
public function getImage()
{
return $this->image;
}
public function setImage($image)
{
$this->image = $image;
return $this;
}
public function getCreateAt(): ?\DateTimeInterface
{
return $this->create_at;
}
public function setCreateAt(\DateTimeInterface $create_at): self
{
$this->create_at = $create_at;
return $this;
}
public function getUpdateAt(): ?\DateTimeInterface
{
return $this->update_at;
}
public function setUpdateAt(?\DateTimeInterface $update_at): self
{
$this->update_at = $update_at;
return $this;
}
public function getMode(): ?string
{
return $this->mode;
}
public function setMode(string $mode): self
{
$this->mode = $mode;
return $this;
}
/**
* @return Collection|Service[]
*/
public function getService(): Collection
{
return $this->service;
}
public function addService(Service $service): self
{
if (!$this->service->contains($service)) {
$this->service[] = $service;
}
return $this;
}
public function removeService(Service $service): self
{
if ($this->service->contains($service)) {
$this->service->removeElement($service);
}
return $this;
}
public function getDateEnvoi(): ?\DateTimeInterface
{
return $this->date_envoi;
}
public function setDateEnvoi(?\DateTimeInterface $date_envoi): self
{
$this->date_envoi = $date_envoi;
return $this;
}
}