<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* CityInsee
*
* @ORM\Table(name="city_insee",
* uniqueConstraints={@ORM\UniqueConstraint(name="search_city_insee_code_insee_unique", columns={"code_insee"})},
* indexes={@ORM\Index(name="search_city_insee_code_insee", columns={"code_insee"}), @ORM\Index(name="search_city_insee_name", columns={"name"})})
* @ORM\Entity(repositoryClass="App\Repository\CityInseeRepository")
*/
class CityInsee
{
/**
* @ORM\Id()
* @ORM\GeneratedValue(strategy="IDENTITY")
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(name="code_insee", type="string", length=255, nullable=true, options={"comment":"code insee"})
*/
private $codeInsee;
/**
* @ORM\Column(name="name", type="string", length=255, nullable=true, options={"comment":"Nom courant en minuscules avec tirets"})
*/
private $name;
/**
* @ORM\Column(name="upper_name", type="string", length=255, nullable=true, options={"comment":"Nom norme poste en majuscules sans apostrophes ni tirets"})
*/
private $upperName;
/**
* @ORM\Column(name="sort_name", type="string", length=255, nullable=true, options={"comment":"nom pour le tri sans article"})
*/
private $sortName;
/**
* @ORM\Column(name="zip_code", type="string", length=255, nullable=true, options={"comment":"code postal"})
*/
private $zipCode;
/**
* @var float|null
*
* @ORM\Column(name="latitude", type="float", nullable=true)
*/
private $latitude;
/**
* @var float|null
*
* @ORM\Column(name="longitude", type="float", nullable=true)
*/
private $longitude;
/**
* @ORM\Column(name="departement_code", type="string", length=255, nullable=true, options={"comment":"Alias utilisé dans les requetes de olapi"})
*/
private $departementCode;
/**
* @ORM\Column(name="departement_name", type="string", length=255, nullable=true, options={"comment":"Nom du département"})
*/
private $departementName;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom de la region"})
*/
private $regionName;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
*/
private $state;
/**
* @ORM\OneToMany(targetEntity="App\Entity\DnsitProduct", mappedBy="cityInsee", orphanRemoval=true)
*/
private $products;
/**
* @ORM\OneToMany(targetEntity="App\Entity\DnsitTranslateProduct", mappedBy="cityInsee", orphanRemoval=true)
*/
private $translateProducts;
public function __construct()
{
// $this->fields = new ArrayCollection();
$this->products = new ArrayCollection();
$this->translateProducts = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getCodeInsee(): ?string
{
return $this->codeInsee;
}
public function setCodeInsee(?string $codeInsee): self
{
$this->codeInsee = $codeInsee;
return $this;
}
public function getUpperName(): ?string
{
return $this->upperName;
}
public function setUpperName(?string $upperName): self
{
$this->upperName = $upperName;
return $this;
}
public function getSortName(): ?string
{
return $this->sortName;
}
public function setSortName(?string $sortName): self
{
$this->sortName = $sortName;
return $this;
}
public function getZipCode(): ?string
{
return $this->zipCode;
}
public function setZipCode(?string $zipCode): self
{
$this->zipCode = $zipCode;
return $this;
}
public function getDepartementCode(): ?string
{
return $this->departementCode;
}
public function setDepartementCode(?string $departementCode): self
{
$this->departementCode = $departementCode;
return $this;
}
public function getDepartementName(): ?string
{
return $this->departementName;
}
public function setDepartementName(?string $departementName): self
{
$this->departementName = $departementName;
return $this;
}
public function getRegionName(): ?string
{
return $this->regionName;
}
public function setRegionName(?string $regionName): self
{
$this->regionName = $regionName;
return $this;
}
public function getLatitude(): ?float
{
return $this->latitude;
}
public function setLatitude(?float $latitude): self
{
$this->latitude = $latitude;
return $this;
}
public function getLongitude(): ?float
{
return $this->longitude;
}
public function setLongitude(?float $longitude): self
{
$this->longitude = $longitude;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getState(): ?int
{
return $this->state;
}
public function setState(?int $state): self
{
$this->state = $state;
return $this;
}
/**
* @return Collection|DataField[]
*/
public function getFields(): Collection
{
return $this->fields;
}
public function addField(DataField $field): self
{
if (!$this->fields->contains($field)) {
$this->fields[] = $field;
$field->setDataEntity($this);
}
return $this;
}
public function removeField(DataField $field): self
{
if ($this->fields->contains($field)) {
$this->fields->removeElement($field);
// set the owning side to null (unless already changed)
if ($field->getDataEntity() === $this) {
$field->setDataEntity(null);
}
}
return $this;
}
public function getAlias(): ?string
{
return $this->alias;
}
public function setAlias(?string $alias): self
{
$this->alias = $alias;
return $this;
}
/**
* @return Collection|DnsitProduct[]
*/
public function getProducts(): Collection
{
return $this->products;
}
public function addProduct(DnsitProduct $product): self
{
if (!$this->products->contains($product)) {
$this->products[] = $product;
$product->setCityInsee($this);
}
return $this;
}
public function removeProduct(DnsitProduct $product): self
{
if ($this->products->contains($product)) {
$this->products->removeElement($product);
// set the owning side to null (unless already changed)
if ($product->getCityInsee() === $this) {
$product->setCityInsee(null);
}
}
return $this;
}
/**
* @return Collection|DnsitTranslateProduct[]
*/
public function getTranslateProducts(): Collection
{
return $this->translateProducts;
}
public function addTranslateProduct(DnsitTranslateProduct $translateProduct): self
{
if (!$this->translateProducts->contains($translateProduct)) {
$this->translateProducts[] = $translateProduct;
$translateProduct->setCityInsee($this);
}
return $this;
}
public function removeTranslateProduct(DnsitTranslateProduct $translateProduct): self
{
if ($this->translateProducts->contains($translateProduct)) {
$this->translateProducts->removeElement($translateProduct);
// set the owning side to null (unless already changed)
if ($translateProduct->getCityInsee() === $this) {
$translateProduct->setCityInsee(null);
}
}
return $this;
}
}