<?php
namespace App\Entity;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use APY\DataGridBundle\Grid\Mapping as GRID;
use App\Entity\RecTypePopulation;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Type;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Client
*
* @ORM\Table(name="rec_email")
* @ORM\HasLifecycleCallbacks
* @ORM\Entity(repositoryClass="App\Repository\RecEmailRepository")
* @GRID\Source(columns="id, sujet, sendDate, destinataires, contenu")
*/
class RecEmail
{
/**
* @var integer
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @GRID\Column(title="Id", size="100", type="text",visible=false)
*/
private $id;
/**
* @ORM\Column(name="sujet", type= "string", length=150)
* @Assert\NotBlank()
* @GRID\Column(title="Sujet", size="150", type="text")
*/
protected $sujet;
/**
* @var \DateTime
* @ORM\Column(name="send_date", type="datetime")
* @GRID\Column(title="Date d'envoi", size="150", type="date", format="d/m/Y à H:s"),
*/
private $sendDate;
/**
* @var \string
* @ORM\Column(name="destinataires", type="text")
* @GRID\Column(title="Destinataires", size="150", type="text", format="d/m/Y"),
*/
private $destinataires;
/**
* @var \string
* @ORM\Column(name="contenu", type="text")
*/
private $contenu;
/**
* @ORM\ManyToOne(targetEntity="RecPoste", inversedBy="email")
* @ORM\JoinColumn(name="poste_id", referencedColumnName="id")
*/
protected $poste;
/**
* @ORM\Column(name="error", type="boolean")
*/
private $error;
/**
* @ORM\OneToMany(targetEntity="App\Entity\RecPieceJointe", mappedBy="emails", cascade={"remove"})
*/
private $pj;
/**
* Constructor
*/
public function __construct()
{
$this->pj = new \Doctrine\Common\Collections\ArrayCollection();
$this->error = false;
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set sujet
*
* @param string $sujet
* @return RecEmail
*/
public function setSujet($sujet)
{
$this->sujet = $sujet;
return $this;
}
/**
* Get sujet
*
* @return string
*/
public function getSujet()
{
return $this->sujet;
}
/**
* Set sendDate
*
* @param \DateTime $sendDate
* @return RecEmail
*/
public function setSendDate($sendDate)
{
$this->sendDate = $sendDate;
return $this;
}
/**
* Get sendDate
*
* @return \DateTime
*/
public function getSendDate()
{
return $this->sendDate;
}
/**
* Set destinataires
*
* @param string $destinataires
* @return RecEmail
*/
public function setDestinataires($destinataires)
{
$this->destinataires = $destinataires;
return $this;
}
/**
* Get destinataires
*
* @return string
*/
public function getDestinataires()
{
return $this->destinataires;
}
/**
* Set contenu
*
* @param string $contenu
* @return RecEmail
*/
public function setContenu($contenu)
{
$this->contenu = $contenu;
return $this;
}
/**
* Get contenu
*
* @return string
*/
public function getContenu()
{
return $this->contenu;
}
/**
* Set poste
*
* @param \App\Entity\RecPoste $poste
* @return RecEmail
*/
public function setPoste(\App\Entity\RecPoste $poste = null)
{
$this->poste = $poste;
return $this;
}
/**
* Get poste
*
* @return \Dosi\RecrutementBundle\Entity\RecPoste
*/
public function getPoste()
{
return $this->poste;
}
/**
* Set error
*
* @param boolean $error
* @return RecEmail
*/
public function setError($error)
{
$this->error = $error;
return $this;
}
/**
* Get error
*
* @return boolean
*/
public function getError()
{
return $this->error;
}
/**
* Add pj
*
* @param \App\Entity\RecPieceJointe $pj
* @return RecEmail
*/
public function addPj(\App\Entity\RecPieceJointe $pj)
{
$this->pj[] = $pj;
return $this;
}
/**
* Remove pj
*
* @param \App\Entity\RecPieceJointe $pj
*/
public function removePj(\App\Entity\RecPieceJointe $pj)
{
$this->pj->removeElement($pj);
}
/**
* Get pj
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPj()
{
return $this->pj;
}
public function isError(): ?bool
{
return $this->error;
}
}