<?php
namespace TheatreCore\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Persons
*
* @ORM\Table(name="persons", uniqueConstraints={@ORM\UniqueConstraint(name="url_clean", columns={"url_clean"})}, indexes={@ORM\Index(name="valid", columns={"valid"}), @ORM\Index(name="url_redirect", columns={"url_redirect"}), @ORM\Index(name="lastname", columns={"lastname"}), @ORM\Index(name="country", columns={"country"}), @ORM\Index(name="idextranetuser", columns={"idextranetuser"}), @ORM\Index(name="firstname", columns={"firstname"}), @ORM\Index(name="idrole", columns={"idrole"}), @ORM\Index(name="ccountry", columns={"ccountry"})})
* @ORM\Entity(repositoryClass="TheatreCore\Repository\PersonsRepository")
*/
class Persons
{
/**
* @var int
*
* @ORM\Column(name="idperson", type="integer", nullable=false, options={"unsigned"=true})
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*
*/
private $idperson;
/**
* @var string|null
*
* @ORM\Column(name="lastname", type="string", length=255, nullable=true)
*
*
* @Assert\NotBlank(message="Veuillez préciser le nom")
* @Assert\Length(
* min = 2,
* max = 50,
* minMessage = "Your first name must be at least {{ limit }} characters long",
* maxMessage = "Your first name cannot be longer than {{ limit }} characters"
* )
*
*/
private $lastname;
/**
* @var string|null
*
* @ORM\Column(name="firstname", type="string", length=255, nullable=true)
*/
private $firstname;
/**
* @var int
*
* @ORM\Column(name="sexe", type="smallint", nullable=false)
*
* @Assert\NotBlank(message="Veuillez préciser le sexe")
*
*/
private $sexe;
/**
* @var int|null
*
* @ORM\Column(name="datestart", type="smallint", nullable=true)
*/
private $datestart;
/**
* @var int|null
*
* @ORM\Column(name="dateend", type="smallint", nullable=true)
*/
private $dateend;
/**
* @var string|null
*
* @ORM\Column(name="language", type="string", length=2, nullable=true)
*/
private $language;
/**
* @var string|null
*
* @ORM\Column(name="language2", type="string", length=2, nullable=true)
*/
private $language2;
/**
* @var string|null
*
* @ORM\Column(name="email", type="string", length=255, nullable=true)
*/
private $email;
/**
* @var string|null
*
* @ORM\Column(name="comment", type="text", length=65535, nullable=true)
*/
private $comment;
/**
* @var string|null
*
* @ORM\Column(name="cname", type="string", length=255, nullable=true)
*/
private $cname;
/**
* @var string|null
*
* @ORM\Column(name="caddress", type="text", length=65535, nullable=true)
*/
private $caddress;
/**
* @var string|null
*
* @ORM\Column(name="czip", type="string", length=100, nullable=true)
*/
private $czip;
/**
* @var string|null
*
* @ORM\Column(name="ccity", type="string", length=100, nullable=true)
*/
private $ccity;
/**
* @var string|null
*
* @ORM\Column(name="ccountry", type="string", length=2, nullable=true, options={"fixed"=true})
*/
private $ccountry;
/**
* @var string|null
*
* @ORM\Column(name="cphone", type="string", length=100, nullable=true)
*/
private $cphone;
/**
* @var string|null
*
* @ORM\Column(name="cfax", type="string", length=100, nullable=true)
*/
private $cfax;
/**
* @var string|null
*
* @ORM\Column(name="cemail", type="string", length=255, nullable=true)
*/
private $cemail;
/**
* @var string|null
*
* @ORM\Column(name="cmobile", type="string", length=50, nullable=true)
*/
private $cmobile;
/**
* @var string|null
*
* @ORM\Column(name="url_redirect", type="string", length=250, nullable=true)
*/
private $urlRedirect;
/**
* @var string
*
* @ORM\Column(name="url_clean", type="string", length=250, nullable=false)
*/
private $urlClean;
/**
* @var string|null
*
* @ORM\Column(name="url_mav", type="string", length=250, nullable=true)
*/
private $urlMav;
/**
* @var \DateTime|null
*
* @ORM\Column(name="dateupdate", type="datetime", nullable=true)
*/
private $dateupdate;
/**
* @var \DateTime|null
*
* @ORM\Column(name="dateinsert", type="datetime", nullable=true)
*/
private $dateinsert;
/**
* @var bool
*
* @ORM\Column(name="publish", type="boolean", nullable=false, options={"default"="1"})
*/
private $publish = true;
/**
* @var bool
*
* @ORM\Column(name="valid", type="boolean", nullable=false)
*/
private $valid = false;
/**
* @var \Countries
*
* @ORM\ManyToOne(targetEntity="Countries")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="country", referencedColumnName="id")
* })
*/
private $country;
/**
* @var \Roles
*
* @ORM\ManyToOne(targetEntity="Roles")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="idrole", referencedColumnName="idrole")
* })
*/
private $idrole;
/**
* @var \Extranetusers
*
* @ORM\ManyToOne(targetEntity="Extranetusers")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="idextranetuser", referencedColumnName="idextranetuser")
* })
*/
private $idextranetuser;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\ManyToMany(targetEntity="News", mappedBy="idperson")
*/
private $idnew;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\ManyToMany(targetEntity="Classifications", inversedBy="idperson")
* @ORM\JoinTable(name="person_classification",
* joinColumns={
* @ORM\JoinColumn(name="idperson", referencedColumnName="idperson")
* },
* inverseJoinColumns={
* @ORM\JoinColumn(name="idclassification", referencedColumnName="idclassification")
* }
* )
*
*/
private $person_classification;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\ManyToMany(targetEntity="Contacts", inversedBy="idperson")
* @ORM\JoinTable(name="person_ecole",
* joinColumns={
* @ORM\JoinColumn(name="idperson", referencedColumnName="idperson")
* },
* inverseJoinColumns={
* @ORM\JoinColumn(name="idcontact", referencedColumnName="idcontact")
* }
* )
*/
private $idcontact;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\ManyToMany(targetEntity="Extranetusers", inversedBy="idperson")
* @ORM\JoinTable(name="person_extranetuser",
* joinColumns={
* @ORM\JoinColumn(name="idperson", referencedColumnName="idperson")
* },
* inverseJoinColumns={
* @ORM\JoinColumn(name="idextranetuser", referencedColumnName="idextranetuser")
* }
* )
*/
private $personextranetuser;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\ManyToMany(targetEntity="Podcasts", mappedBy="idperson")
*/
private $idpodcast;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\ManyToMany(targetEntity="Spectacles", mappedBy="idperson")
*/
private $idspectacle;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\ManyToMany(targetEntity="Texts", mappedBy="text_author")
*/
private $textAuthortext;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\ManyToMany(targetEntity="Texts", mappedBy="textTranslator")
*/
private $textTranslatortext;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\ManyToMany(targetEntity="Texts", mappedBy="text_person")
*/
private $textPersontext;
/**
* @var int
*
* @ORM\Column(name="idcorvin", type="integer", nullable=true, options={"unsigned"=true})
*
*/
private ?int $idcorvin;
/**
* Constructor
*/
public function __construct()
{
$this->idnew = new \Doctrine\Common\Collections\ArrayCollection();
$this->idclassification = new \Doctrine\Common\Collections\ArrayCollection();
$this->idcontact = new \Doctrine\Common\Collections\ArrayCollection();
$this->personextranetuser = new \Doctrine\Common\Collections\ArrayCollection();
$this->idpodcast = new \Doctrine\Common\Collections\ArrayCollection();
$this->idspectacle = new \Doctrine\Common\Collections\ArrayCollection();
$this->textAuthortext = new \Doctrine\Common\Collections\ArrayCollection();
$this->textTranslatortext = new \Doctrine\Common\Collections\ArrayCollection();
$this->textPerson = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get idperson.
*
* @return int
*/
public function getIdperson()
{
return $this->idperson;
}
/**
* @return int
*/
public function getIdCorvin(): ?int
{
return $this->idcorvin;
}
public function setIdCorvin(?int $idcorvin): self
{
$this->idcorvin = $idcorvin;
return $this;
}
/**
* Set lastname.
*
* @param string|null $lastname
*
* @return Persons
*/
public function setLastname($lastname = null)
{
$this->lastname = $lastname;
return $this;
}
/**
* Get lastname.
*
* @return string|null
*/
public function getLastname()
{
return $this->lastname;
}
/**
* Set firstname.
*
* @param string|null $firstname
*
* @return Persons
*/
public function setFirstname($firstname = null)
{
$this->firstname = $firstname;
return $this;
}
/**
* Get firstname.
*
* @return string|null
*/
public function getFirstname()
{
return $this->firstname;
}
/**
* Set sexe.
*
* @param int $sexe
*
* @return Persons
*/
public function setSexe($sexe)
{
$this->sexe = $sexe;
return $this;
}
/**
* Get sexe.
*
* @return int
*/
public function getSexe()
{
return $this->sexe;
}
/**
* Set datestart.
*
* @param int|null $datestart
*
* @return Persons
*/
public function setDatestart($datestart = null)
{
$this->datestart = $datestart;
return $this;
}
/**
* Get datestart.
*
* @return int|null
*/
public function getDatestart()
{
return $this->datestart;
}
/**
* Set dateend.
*
* @param int|null $dateend
*
* @return Persons
*/
public function setDateend($dateend = null)
{
$this->dateend = $dateend;
return $this;
}
/**
* Get dateend.
*
* @return int|null
*/
public function getDateend()
{
return $this->dateend;
}
/**
* Set language.
*
* @param string|null $language
*
* @return Persons
*/
public function setLanguage($language = null)
{
$this->language = $language;
return $this;
}
/**
* Get language.
*
* @return string|null
*/
public function getLanguage()
{
return $this->language;
}
/**
* Set language2.
*
* @param string|null $language2
*
* @return Persons
*/
public function setLanguage2($language2 = null)
{
$this->language2 = $language2;
return $this;
}
/**
* Get language2.
*
* @return string|null
*/
public function getLanguage2()
{
return $this->language2;
}
/**
* Set email.
*
* @param string|null $email
*
* @return Persons
*/
public function setEmail($email = null)
{
$this->email = $email;
return $this;
}
/**
* Get email.
*
* @return string|null
*/
public function getEmail()
{
return $this->email;
}
/**
* Set comment.
*
* @param string|null $comment
*
* @return Persons
*/
public function setComment($comment = null)
{
$this->comment = $comment;
return $this;
}
/**
* Get comment.
*
* @return string|null
*/
public function getComment()
{
return $this->comment;
}
/**
* Set cname.
*
* @param string|null $cname
*
* @return Persons
*/
public function setCname($cname = null)
{
$this->cname = $cname;
return $this;
}
/**
* Get cname.
*
* @return string|null
*/
public function getCname()
{
return $this->cname;
}
/**
* Set caddress.
*
* @param string|null $caddress
*
* @return Persons
*/
public function setCaddress($caddress = null)
{
$this->caddress = $caddress;
return $this;
}
/**
* Get caddress.
*
* @return string|null
*/
public function getCaddress()
{
return $this->caddress;
}
/**
* Set czip.
*
* @param string|null $czip
*
* @return Persons
*/
public function setCzip($czip = null)
{
$this->czip = $czip;
return $this;
}
/**
* Get czip.
*
* @return string|null
*/
public function getCzip()
{
return $this->czip;
}
/**
* Set ccity.
*
* @param string|null $ccity
*
* @return Persons
*/
public function setCcity($ccity = null)
{
$this->ccity = $ccity;
return $this;
}
/**
* Get ccity.
*
* @return string|null
*/
public function getCcity()
{
return $this->ccity;
}
/**
* Set ccountry.
*
* @param string|null $ccountry
*
* @return Persons
*/
public function setCcountry($ccountry = null)
{
$this->ccountry = $ccountry;
return $this;
}
/**
* Get ccountry.
*
* @return string|null
*/
public function getCcountry()
{
return $this->ccountry;
}
/**
* Set cphone.
*
* @param string|null $cphone
*
* @return Persons
*/
public function setCphone($cphone = null)
{
$this->cphone = $cphone;
return $this;
}
/**
* Get cphone.
*
* @return string|null
*/
public function getCphone()
{
return $this->cphone;
}
/**
* Set cfax.
*
* @param string|null $cfax
*
* @return Persons
*/
public function setCfax($cfax = null)
{
$this->cfax = $cfax;
return $this;
}
/**
* Get cfax.
*
* @return string|null
*/
public function getCfax()
{
return $this->cfax;
}
/**
* Set cemail.
*
* @param string|null $cemail
*
* @return Persons
*/
public function setCemail($cemail = null)
{
$this->cemail = $cemail;
return $this;
}
/**
* Get cemail.
*
* @return string|null
*/
public function getCemail()
{
return $this->cemail;
}
/**
* Set cmobile.
*
* @param string|null $cmobile
*
* @return Persons
*/
public function setCmobile($cmobile = null)
{
$this->cmobile = $cmobile;
return $this;
}
/**
* Get cmobile.
*
* @return string|null
*/
public function getCmobile()
{
return $this->cmobile;
}
/**
* Set urlRedirect.
*
* @param string|null $urlRedirect
*
* @return Persons
*/
public function setUrlRedirect($urlRedirect = null)
{
$this->urlRedirect = $urlRedirect;
return $this;
}
/**
* Get urlRedirect.
*
* @return string|null
*/
public function getUrlRedirect()
{
return $this->urlRedirect;
}
/**
* Set urlClean.
*
* @param string $urlClean
*
* @return Persons
*/
public function setUrlClean($urlClean)
{
$this->urlClean = $urlClean;
return $this;
}
/**
* Get urlClean.
*
* @return string
*/
public function getUrlClean()
{
return $this->urlClean;
}
/**
* Set urlMav.
*
* @param string|null $urlMav
*
* @return Persons
*/
public function setUrlMav($urlMav = null)
{
$this->urlMav = $urlMav;
return $this;
}
/**
* Get urlMav.
*
* @return string|null
*/
public function getUrlMav()
{
return $this->urlMav;
}
/**
* Set dateupdate.
*
* @param \DateTime|null $dateupdate
*
* @return Persons
*/
public function setDateupdate($dateupdate = null)
{
$this->dateupdate = $dateupdate;
return $this;
}
/**
* Get dateupdate.
*
* @return \DateTime|null
*/
public function getDateupdate()
{
return $this->dateupdate;
}
/**
* Set dateinsert.
*
* @param \DateTime|null $dateinsert
*
* @return Persons
*/
public function setDateinsert($dateinsert = null)
{
$this->dateinsert = $dateinsert;
return $this;
}
/**
* Get dateinsert.
*
* @return \DateTime|null
*/
public function getDateinsert()
{
return $this->dateinsert;
}
/**
* Set publish.
*
* @param bool $publish
*
* @return Persons
*/
public function setPublish($publish)
{
$this->publish = $publish;
return $this;
}
/**
* Get publish.
*
* @return bool
*/
public function getPublish()
{
return $this->publish;
}
/**
* Set valid.
*
* @param bool $valid
*
* @return Persons
*/
public function setValid($valid)
{
$this->valid = $valid;
return $this;
}
/**
* Get valid.
*
* @return bool
*/
public function getValid()
{
return $this->valid;
}
/**
* Set country.
*
* @param \Countries|null $country
*
* @return Persons
*/
public function setCountry(Countries $country = null)
{
$this->country = $country;
return $this;
}
/**
* Get country.
*
* @return \Countries|null
*/
public function getCountry()
{
return $this->country;
}
/**
* Set idrole.
*
* @param \Roles|null $idrole
*
* @return Persons
*/
public function setIdrole(Roles $idrole = null)
{
$this->idrole = $idrole;
return $this;
}
/**
* Get idrole.
*
* @return \Roles|null
*/
public function getIdrole()
{
return $this->idrole;
}
/**
* Set idextranetuser.
*
* @param \Extranetusers|null $idextranetuser
*
* @return Persons
*/
public function setIdextranetuser(Extranetusers $idextranetuser = null)
{
$this->idextranetuser = $idextranetuser;
return $this;
}
/**
* Get idextranetuser.
*
* @return \Extranetusers|null
*/
public function getIdextranetuser()
{
return $this->idextranetuser;
}
/**
* Add idnew.
*
* @param \News $idnew
*
* @return Persons
*/
public function addIdnew(News $idnew)
{
$this->idnew[] = $idnew;
return $this;
}
/**
* Remove idnew.
*
* @param \News $idnew
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
public function removeIdnew(News $idnew)
{
return $this->idnew->removeElement($idnew);
}
/**
* Get idnew.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getIdnew()
{
return $this->idnew;
}
/**
* Add person_classification.
*
* @param \Classifications $person_classification
*
* @return Persons
*/
public function addPersonClassification(Classifications $person_classification)
{
$this->person_classification[] = $person_classification;
return $this;
}
/**
* Remove person_classification.
*
* @param \Classifications $person_classification
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
public function remmovePersonClassification(Classifications $person_classification)
{
return $this->person_classification->removeElement($person_classification);
}
/**
* Get person_classification.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPersonClassification()
{
return $this->person_classification;
}
/**
* Add idcontact.
*
* @param \Contacts $idcontact
*
* @return Persons
*/
public function addIdcontact(Contacts $idcontact)
{
$this->idcontact[] = $idcontact;
return $this;
}
/**
* Remove idcontact.
*
* @param \Contacts $idcontact
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
public function removeIdcontact(Contacts $idcontact)
{
return $this->idcontact->removeElement($idcontact);
}
/**
* Get idcontact.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getIdcontact()
{
return $this->idcontact;
}
/**
* Add personextranetuser.
*
* @param \Extranetusers $personextranetuser
*
* @return Persons
*/
public function addPersonextranetuser(Extranetusers $personextranetuser)
{
$this->personextranetuser[] = $personextranetuser;
return $this;
}
/**
* Remove personextranetuser.
*
* @param \Extranetusers $personextranetuser
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
public function removePersonextranetuser(Extranetusers $personextranetuser)
{
return $this->personextranetuser->removeElement($personextranetuser);
}
/**
* Get personextranetuser.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPersonextranetuser()
{
return $this->personextranetuser;
}
/**
* Add idpodcast.
*
* @param \Podcasts $idpodcast
*
* @return Persons
*/
public function addIdpodcast(Podcasts $idpodcast)
{
$this->idpodcast[] = $idpodcast;
return $this;
}
/**
* Remove idpodcast.
*
* @param \Podcasts $idpodcast
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
public function removeIdpodcast(Podcasts $idpodcast)
{
return $this->idpodcast->removeElement($idpodcast);
}
/**
* Get idpodcast.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getIdpodcast()
{
return $this->idpodcast;
}
/**
* Add idspectacle.
*
* @param \Spectacles $idspectacle
*
* @return Persons
*/
public function addIdspectacle(Spectacles $idspectacle)
{
$this->idspectacle[] = $idspectacle;
return $this;
}
/**
* Remove idspectacle.
*
* @param \Spectacles $idspectacle
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
public function removeIdspectacle(Spectacles $idspectacle)
{
return $this->idspectacle->removeElement($idspectacle);
}
/**
* Get idspectacle.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getIdspectacle()
{
return $this->idspectacle;
}
/**
* Add textAuthortext.
*
* @param \Texts $textAuthortext
*
* @return Persons
*/
public function addTextAuthortext(Texts $textAuthortext)
{
$this->textAuthortext[] = $textAuthortext;
return $this;
}
/**
* Remove textAuthortext.
*
* @param \Texts $textAuthortext
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
public function removeTextAuthortext(Texts $textAuthortext)
{
return $this->textAuthortext->removeElement($textAuthortext);
}
/**
* Get textAuthortext.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getTextAuthortext()
{
return $this->textAuthortext;
}
/**
* Add textTranslatortext.
*
* @param \Texts $textTranslatortext
*
* @return Persons
*/
public function addTextTranslatortext(Texts $textTranslatortext)
{
$this->textTranslatortext[] = $textTranslatortext;
return $this;
}
/**
* Remove textTranslatortext.
*
* @param \Texts $textTranslatortext
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
public function removeTextTranslatortext(Texts $textTranslatortext)
{
return $this->textTranslatortext->removeElement($textTranslatortext);
}
/**
* Get textTranslatortext.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getTextTranslatortext()
{
return $this->textTranslatortext;
}
/**
* Add textPersontext
*
* @param \Texts $textPersontext
*
* @return Persons
*/
public function addTextPersontext(Texts $textPersontext)
{
$this->textPersontext[] = $textPersontext;
return $this;
}
/**
* Remove textPersontext
*
* @param \Texts $textPersontext
*
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
*/
public function removeTextPersontext(Texts $textPersontext)
{
return $this->textPersontext->removeElement($textPersontext);
}
/**
* Get textPersontext
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getTextPersontext()
{
return $this->textPersontext;
}
/**
* Assign entity properties using an array
*
* @param array $attributes assoc array of values to assign
* @return null
*/
public function fromArray(array $attributes)
{
foreach ($attributes as $name => $value) {
if (property_exists($this, $name)) {
$methodName = $this->_getSetterName($name);
if ($methodName) {
$this->{$methodName}($value);
} else {
$this->$name = $value;
}
}
}
}
/**
* Get property setter method name (if exists)
*
* @param string $propertyName entity property name
* @return false|string
*/
protected function _getSetterName($propertyName)
{
$prefixes = array('add', 'set');
foreach ($prefixes as $prefix) {
$methodName = sprintf('%s%s', $prefix, ucfirst(strtolower($propertyName)));
if (method_exists($this, $methodName)) {
return $methodName;
}
}
return false;
}
public function __toString()
{
return $this->firstname . ' ' . $this->lastname;
}
}