src/Entity/RecCategoryPopulation.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\Collection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use APY\DataGridBundle\Grid\Mapping as GRID;
  8. /**
  9.  * Client
  10.  *
  11.  * @ORM\Table(name="rec_cat_population")
  12.  * @ORM\HasLifecycleCallbacks
  13.  * @ORM\Entity(repositoryClass="App\Repository\RecCategoryPopulationRepository")
  14.  * @GRID\Source(columns="id, identifiant, name")
  15.  */
  16. class RecCategoryPopulation
  17. {
  18.     /**
  19.      * @ORM\Id
  20.      * @ORM\Column(type="integer")
  21.      * @ORM\GeneratedValue(strategy="AUTO")
  22.      * @GRID\Column(title="Id", size="100", type="text",visible=false)
  23.      */
  24.     protected $id;
  25.     /**
  26.      * @Assert\NotBlank()
  27.      * @Assert\Length(
  28.      *     min = "2",
  29.      *  max = "20"
  30.      * )
  31.      * @ORM\Column(type="string", length=20)
  32.      * @GRID\Column(title="Id", size="500", type="text")
  33.      */
  34.     protected $identifiant;
  35.     /**
  36.      * @Assert\NotBlank()
  37.      * @Assert\Length(
  38.      *     min = "2",
  39.      *  max = "120"
  40.      * )
  41.      * @ORM\Column(type="string", length=120)
  42.      * @GRID\Column(title="Nom", size="300", type="text")
  43.      */
  44.     protected $name;
  45.     /**
  46.      * @ORM\OneToMany(targetEntity="RecTypePopulation", mappedBy="catpopulation")
  47.      */
  48.     protected $typePopulation;
  49.     /**
  50.      * @ORM\Column(name="archive", type="boolean", nullable=true)
  51.      */
  52.     private $archive;
  53.     public function __construct()
  54.     {
  55.         $this->archive false;
  56.         $this->typePopulation = new ArrayCollection();
  57.     }
  58.     /**
  59.      * Get id
  60.      *
  61.      * @return integer 
  62.      */
  63.     public function getId()
  64.     {
  65.         return $this->id;
  66.     }
  67.     /**
  68.      * Set identifiant
  69.      *
  70.      * @param string $identifiant
  71.      * @return RecCategoryPopulation
  72.      */
  73.     public function setIdentifiant($identifiant)
  74.     {
  75.         $this->identifiant $identifiant;
  76.         return $this;
  77.     }
  78.     /**
  79.      * Get identifiant
  80.      *
  81.      * @return string 
  82.      */
  83.     public function getIdentifiant()
  84.     {
  85.         return $this->identifiant;
  86.     }
  87.     /**
  88.      * Set name
  89.      *
  90.      * @param string $name
  91.      * @return RecCategoryPopulation
  92.      */
  93.     public function setName($name)
  94.     {
  95.         $this->name $name;
  96.         return $this;
  97.     }
  98.     /**
  99.      * Get name
  100.      *
  101.      * @return string 
  102.      */
  103.     public function getName()
  104.     {
  105.         return $this->name;
  106.     }
  107.     /**
  108.      * Add typePopulation
  109.      *
  110.      * @param \App\Entity\RecTypePopulation $typePopulation
  111.      * @return RecCategoryPopulation
  112.      */
  113.     public function addTypePopulation(\App\Entity\RecTypePopulation $typePopulation)
  114.     {
  115.         $this->typePopulation[] = $typePopulation;
  116.         return $this;
  117.     }
  118.     /**
  119.      * Remove typePopulation
  120.      *
  121.      * @param \App\Entity\RecTypePopulation $typePopulation
  122.      */
  123.     public function removeTypePopulation(\App\Entity\RecTypePopulation $typePopulation)
  124.     {
  125.         $this->typePopulation->removeElement($typePopulation);
  126.     }
  127.     /**
  128.      * Get typePopulation
  129.      *
  130.      * @return \Doctrine\Common\Collections\Collection 
  131.      */
  132.     public function getTypePopulation()
  133.     {
  134.         return $this->typePopulation;
  135.     }
  136.     /**
  137.      * Set private.
  138.      *
  139.      * @param bool|null $private
  140.      *
  141.      * @return RecCategoryPopulation
  142.      */
  143.     public function setPrivate($private null)
  144.     {
  145.         $this->private $private;
  146.         return $this;
  147.     }
  148.     /**
  149.      * Get private.
  150.      *
  151.      * @return bool|null
  152.      */
  153.     public function getPrivate()
  154.     {
  155.         return $this->private;
  156.     }
  157.     public function isArchive(): ?bool
  158.     {
  159.         return $this->archive;
  160.     }
  161.     public function setArchive(?bool $archive): static
  162.     {
  163.         $this->archive $archive;
  164.         return $this;
  165.     }
  166. }