<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\HttpFoundation\File\File;
/**
* @ORM\Entity(repositoryClass="App\Repository\PubliciteRepository")
*/
class Publicite
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $libelle;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="date")
*/
private $debut;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $fin;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $support;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $espace;
/**
* @ORM\Column(type="boolean")
*/
private $status;
/**
* @ORM\Column(type="datetime")
*/
private $create_at;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $update_at;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\TypePub", inversedBy="publicite")
*/
private $type;
const espaces = ['Header','Pub','body'],
espaces_long =['EntĂȘte','Pub','Corps'];
function __construct()
{
$this->status=false;
//$this->roles = ['ROLE_USER'];
$this->create_at=new \DateTime('UTC');
//$this->loginattemps = new ArrayCollection();
//$this->trackings = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setLibelle(string $libelle): self
{
$this->libelle = $libelle;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getDebut(): ?\DateTimeInterface
{
return $this->debut;
}
public function setDebut(\DateTimeInterface $debut): self
{
$this->debut = $debut;
return $this;
}
public function getFin(): ?\DateTimeInterface
{
return $this->fin;
}
public function setFin(?\DateTimeInterface $fin): self
{
$this->fin = $fin;
return $this;
}
public function getSupport()
{
return $this->support;
}
public function setSupport($support)
{
$this->support = $support;
return $this;
}
public function getEspace(): ?string
{
return $this->espace;
}
public function getFullEspace(): ?string
{
return self::espaces[$this->espace];
}
public function getFullEspaceLong(): ?string
{
return self::espaces_long[$this->espace];
}
public function setEspace(?string $espace): self
{
$this->espace = $espace;
return $this;
}
public function getStatus(): ?bool
{
return $this->status;
}
public function setStatus(bool $status): self
{
$this->status = $status;
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 getType(): ?TypePub
{
return $this->type;
}
public function setType(?TypePub $type): self
{
$this->type = $type;
return $this;
}
}