src/Entity/CityInsee.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * CityInsee
  8.  *
  9.  * @ORM\Table(name="city_insee",
  10.  *     uniqueConstraints={@ORM\UniqueConstraint(name="search_city_insee_code_insee_unique", columns={"code_insee"})},
  11.  *     indexes={@ORM\Index(name="search_city_insee_code_insee", columns={"code_insee"}), @ORM\Index(name="search_city_insee_name", columns={"name"})})
  12.  * @ORM\Entity(repositoryClass="App\Repository\CityInseeRepository")
  13.  */
  14. class CityInsee
  15. {
  16.     /**
  17.      * @ORM\Id()
  18.      * @ORM\GeneratedValue(strategy="IDENTITY")
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\Column(name="code_insee", type="string", length=255, nullable=true, options={"comment":"code insee"})
  24.      */
  25.     private $codeInsee;
  26.     /**
  27.      * @ORM\Column(name="name", type="string", length=255, nullable=true, options={"comment":"Nom courant en minuscules avec tirets"})
  28.      */
  29.     private $name;
  30.     /**
  31.      * @ORM\Column(name="upper_name", type="string", length=255, nullable=true, options={"comment":"Nom norme poste en majuscules sans apostrophes ni tirets"})
  32.      */
  33.     private $upperName;
  34.     /**
  35.      * @ORM\Column(name="sort_name", type="string", length=255, nullable=true, options={"comment":"nom pour le tri sans article"})
  36.      */
  37.     private $sortName;
  38.     /**
  39.      * @ORM\Column(name="zip_code", type="string", length=255, nullable=true, options={"comment":"code postal"})
  40.      */
  41.     private $zipCode;
  42.     /**
  43.      * @var float|null
  44.      *
  45.      * @ORM\Column(name="latitude", type="float", nullable=true)
  46.      */
  47.     private $latitude;
  48.     /**
  49.      * @var float|null
  50.      *
  51.      * @ORM\Column(name="longitude", type="float", nullable=true)
  52.      */
  53.     private $longitude;
  54.     /**
  55.      * @ORM\Column(name="departement_code", type="string", length=255, nullable=true, options={"comment":"Alias utilisé dans les requetes de olapi"})
  56.      */
  57.     private $departementCode;
  58.     /**
  59.      * @ORM\Column(name="departement_name", type="string", length=255, nullable=true, options={"comment":"Nom du département"})
  60.      */
  61.     private $departementName;
  62.     /**
  63.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom de la region"})
  64.      */
  65.     private $regionName;
  66.     /**
  67.      * @ORM\Column(type="datetime", nullable=true)
  68.      */
  69.     private $createdAt;
  70.     /**
  71.      * @ORM\Column(type="datetime", nullable=true)
  72.      */
  73.     private $updatedAt;
  74.     /**
  75.      * @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
  76.      */
  77.     private $state;
  78.     /**
  79.      * @ORM\OneToMany(targetEntity="App\Entity\DnsitProduct", mappedBy="cityInsee", orphanRemoval=true)
  80.      */
  81.     private $products;
  82.     /**
  83.      * @ORM\OneToMany(targetEntity="App\Entity\DnsitTranslateProduct", mappedBy="cityInsee", orphanRemoval=true)
  84.      */
  85.     private $translateProducts;
  86.     public function __construct()
  87.     {
  88.         // $this->fields = new ArrayCollection();
  89.         $this->products = new ArrayCollection();
  90.         $this->translateProducts = new ArrayCollection();
  91.     }
  92.     public function getId(): ?int
  93.     {
  94.         return $this->id;
  95.     }
  96.     public function getName(): ?string
  97.     {
  98.         return $this->name;
  99.     }
  100.     public function setName(?string $name): self
  101.     {
  102.         $this->name $name;
  103.         return $this;
  104.     }
  105.     public function getCodeInsee(): ?string
  106.     {
  107.         return $this->codeInsee;
  108.     }
  109.     public function setCodeInsee(?string $codeInsee): self
  110.     {
  111.         $this->codeInsee $codeInsee;
  112.         return $this;
  113.     }
  114.     public function getUpperName(): ?string
  115.     {
  116.         return $this->upperName;
  117.     }
  118.     public function setUpperName(?string $upperName): self
  119.     {
  120.         $this->upperName $upperName;
  121.         return $this;
  122.     }
  123.     public function getSortName(): ?string
  124.     {
  125.         return $this->sortName;
  126.     }
  127.     public function setSortName(?string $sortName): self
  128.     {
  129.         $this->sortName $sortName;
  130.         return $this;
  131.     }
  132.     public function getZipCode(): ?string
  133.     {
  134.         return $this->zipCode;
  135.     }
  136.     public function setZipCode(?string $zipCode): self
  137.     {
  138.         $this->zipCode $zipCode;
  139.         return $this;
  140.     }
  141.     public function getDepartementCode(): ?string
  142.     {
  143.         return $this->departementCode;
  144.     }
  145.     public function setDepartementCode(?string $departementCode): self
  146.     {
  147.         $this->departementCode $departementCode;
  148.         return $this;
  149.     }
  150.     public function getDepartementName(): ?string
  151.     {
  152.         return $this->departementName;
  153.     }
  154.     public function setDepartementName(?string $departementName): self
  155.     {
  156.         $this->departementName $departementName;
  157.         return $this;
  158.     }
  159.     public function getRegionName(): ?string
  160.     {
  161.         return $this->regionName;
  162.     }
  163.     public function setRegionName(?string $regionName): self
  164.     {
  165.         $this->regionName $regionName;
  166.         return $this;
  167.     }
  168.     public function getLatitude(): ?float
  169.     {
  170.         return $this->latitude;
  171.     }
  172.     public function setLatitude(?float $latitude): self
  173.     {
  174.         $this->latitude $latitude;
  175.         return $this;
  176.     }
  177.     public function getLongitude(): ?float
  178.     {
  179.         return $this->longitude;
  180.     }
  181.     public function setLongitude(?float $longitude): self
  182.     {
  183.         $this->longitude $longitude;
  184.         return $this;
  185.     }
  186.     public function getCreatedAt(): ?\DateTimeInterface
  187.     {
  188.         return $this->createdAt;
  189.     }
  190.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  191.     {
  192.         $this->createdAt $createdAt;
  193.         return $this;
  194.     }
  195.     public function getUpdatedAt(): ?\DateTimeInterface
  196.     {
  197.         return $this->updatedAt;
  198.     }
  199.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  200.     {
  201.         $this->updatedAt $updatedAt;
  202.         return $this;
  203.     }
  204.     public function getState(): ?int
  205.     {
  206.         return $this->state;
  207.     }
  208.     public function setState(?int $state): self
  209.     {
  210.         $this->state $state;
  211.         return $this;
  212.     }
  213.     /**
  214.      * @return Collection|DataField[]
  215.      */
  216.     public function getFields(): Collection
  217.     {
  218.         return $this->fields;
  219.     }
  220.     public function addField(DataField $field): self
  221.     {
  222.         if (!$this->fields->contains($field)) {
  223.             $this->fields[] = $field;
  224.             $field->setDataEntity($this);
  225.         }
  226.         return $this;
  227.     }
  228.     public function removeField(DataField $field): self
  229.     {
  230.         if ($this->fields->contains($field)) {
  231.             $this->fields->removeElement($field);
  232.             // set the owning side to null (unless already changed)
  233.             if ($field->getDataEntity() === $this) {
  234.                 $field->setDataEntity(null);
  235.             }
  236.         }
  237.         return $this;
  238.     }
  239.     public function getAlias(): ?string
  240.     {
  241.         return $this->alias;
  242.     }
  243.     public function setAlias(?string $alias): self
  244.     {
  245.         $this->alias $alias;
  246.         return $this;
  247.     }
  248.     /**
  249.      * @return Collection|DnsitProduct[]
  250.      */
  251.     public function getProducts(): Collection
  252.     {
  253.         return $this->products;
  254.     }
  255.     public function addProduct(DnsitProduct $product): self
  256.     {
  257.         if (!$this->products->contains($product)) {
  258.             $this->products[] = $product;
  259.             $product->setCityInsee($this);
  260.         }
  261.         return $this;
  262.     }
  263.     public function removeProduct(DnsitProduct $product): self
  264.     {
  265.         if ($this->products->contains($product)) {
  266.             $this->products->removeElement($product);
  267.             // set the owning side to null (unless already changed)
  268.             if ($product->getCityInsee() === $this) {
  269.                 $product->setCityInsee(null);
  270.             }
  271.         }
  272.         return $this;
  273.     }
  274.     /**
  275.      * @return Collection|DnsitTranslateProduct[]
  276.      */
  277.     public function getTranslateProducts(): Collection
  278.     {
  279.         return $this->translateProducts;
  280.     }
  281.     public function addTranslateProduct(DnsitTranslateProduct $translateProduct): self
  282.     {
  283.         if (!$this->translateProducts->contains($translateProduct)) {
  284.             $this->translateProducts[] = $translateProduct;
  285.             $translateProduct->setCityInsee($this);
  286.         }
  287.         return $this;
  288.     }
  289.     public function removeTranslateProduct(DnsitTranslateProduct $translateProduct): self
  290.     {
  291.         if ($this->translateProducts->contains($translateProduct)) {
  292.             $this->translateProducts->removeElement($translateProduct);
  293.             // set the owning side to null (unless already changed)
  294.             if ($translateProduct->getCityInsee() === $this) {
  295.                 $translateProduct->setCityInsee(null);
  296.             }
  297.         }
  298.         return $this;
  299.     }
  300. }