<?php
namespace App\Entity;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\Common\Collections\ArrayCollection;
use APY\DataGridBundle\Grid\Mapping as GRID;
/**
* Client
*
* @ORM\Table(name="rec_cat_population")
* @ORM\HasLifecycleCallbacks
* @ORM\Entity(repositoryClass="App\Repository\RecCategoryPopulationRepository")
* @GRID\Source(columns="id, identifiant, name")
*/
class RecCategoryPopulation
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
* @GRID\Column(title="Id", size="100", type="text",visible=false)
*/
protected $id;
/**
* @Assert\NotBlank()
* @Assert\Length(
* min = "2",
* max = "20"
* )
* @ORM\Column(type="string", length=20)
* @GRID\Column(title="Id", size="500", type="text")
*/
protected $identifiant;
/**
* @Assert\NotBlank()
* @Assert\Length(
* min = "2",
* max = "120"
* )
* @ORM\Column(type="string", length=120)
* @GRID\Column(title="Nom", size="300", type="text")
*/
protected $name;
/**
* @ORM\OneToMany(targetEntity="RecTypePopulation", mappedBy="catpopulation")
*/
protected $typePopulation;
/**
* @ORM\Column(name="archive", type="boolean", nullable=true)
*/
private $archive;
public function __construct()
{
$this->archive = false;
$this->typePopulation = new ArrayCollection();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set identifiant
*
* @param string $identifiant
* @return RecCategoryPopulation
*/
public function setIdentifiant($identifiant)
{
$this->identifiant = $identifiant;
return $this;
}
/**
* Get identifiant
*
* @return string
*/
public function getIdentifiant()
{
return $this->identifiant;
}
/**
* Set name
*
* @param string $name
* @return RecCategoryPopulation
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Add typePopulation
*
* @param \App\Entity\RecTypePopulation $typePopulation
* @return RecCategoryPopulation
*/
public function addTypePopulation(\App\Entity\RecTypePopulation $typePopulation)
{
$this->typePopulation[] = $typePopulation;
return $this;
}
/**
* Remove typePopulation
*
* @param \App\Entity\RecTypePopulation $typePopulation
*/
public function removeTypePopulation(\App\Entity\RecTypePopulation $typePopulation)
{
$this->typePopulation->removeElement($typePopulation);
}
/**
* Get typePopulation
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getTypePopulation()
{
return $this->typePopulation;
}
/**
* Set private.
*
* @param bool|null $private
*
* @return RecCategoryPopulation
*/
public function setPrivate($private = null)
{
$this->private = $private;
return $this;
}
/**
* Get private.
*
* @return bool|null
*/
public function getPrivate()
{
return $this->private;
}
public function isArchive(): ?bool
{
return $this->archive;
}
public function setArchive(?bool $archive): static
{
$this->archive = $archive;
return $this;
}
}