src/Entity/Commune.php line 20

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use App\Repository\CommuneRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. /**
  10. * Commune.
  11. *
  12. * @ORM\Table(name="Commune")
  13. *
  14. * @ORM\Entity(repositoryClass=CommuneRepository::class)
  15. */
  16. class Commune
  17. {
  18. /**
  19. * @var int
  20. *
  21. * @ORM\Column(name="id", type="integer")
  22. *
  23. * @ORM\Id
  24. *
  25. * @ORM\GeneratedValue(strategy="AUTO")
  26. */
  27. private $id;
  28. /**
  29. * @var string
  30. *
  31. * @ORM\Column(name="nom", type="string", length=255)
  32. */
  33. private $nom;
  34. /**
  35. * @var string
  36. *
  37. * @ORM\Column(name="nom_insee", type="string", length=255)
  38. */
  39. private $nom_insee;
  40. /**
  41. * @var int
  42. *
  43. * @ORM\Column(name="population", type="integer")
  44. */
  45. private $population;
  46. /**
  47. * @var string
  48. *
  49. * @ORM\Column(name="insee", type="string", length=5)
  50. */
  51. private $insee;
  52. /**
  53. * @var string
  54. *
  55. * @ORM\Column(name="codePostal", type="string", length=5)
  56. */
  57. private $codePostal;
  58. /**
  59. * @var string
  60. *
  61. * @ORM\Column(name="aucode", type="string", length=3)
  62. */
  63. private $aucode;
  64. /**
  65. * @var string
  66. *
  67. * @ORM\Column(name="aulibelle", type="string", length=255)
  68. */
  69. private $aulibelle;
  70. /**
  71. * @var float
  72. *
  73. * @ORM\Column(name="latitude", type="decimal", precision=10, scale=8)
  74. */
  75. private $latitude;
  76. /**
  77. * @var float
  78. *
  79. * @ORM\Column(name="longitude", type="decimal", precision=10, scale=8)
  80. */
  81. private $longitude;
  82. /**
  83. * @ORM\OneToMany(targetEntity="Structure", mappedBy="communeImplementation")
  84. */
  85. private $structuresImplementes;
  86. /**
  87. * @ORM\ManyToMany(targetEntity="Structure", mappedBy="communesZoneInfluence")
  88. */
  89. private $structuresZoneInfluence;
  90. /**
  91. * @ORM\ManyToOne(targetEntity="Departement", inversedBy="communes")
  92. *
  93. * @ORM\JoinColumn(name="departement_id", referencedColumnName="id")
  94. */
  95. private $departement;
  96. /**
  97. * Constructor.
  98. */
  99. public function __construct()
  100. {
  101. $this->structuresImplementes = new \Doctrine\Common\Collections\ArrayCollection();
  102. $this->structuresZoneInfluence = new \Doctrine\Common\Collections\ArrayCollection();
  103. }
  104. /**
  105. * Methode pour afficher la commune.
  106. */
  107. #[\Override]
  108. public function __toString(): string
  109. {
  110. if ('' != $this->getNom()) {
  111. return $this->nom;
  112. } else {
  113. return ' ';
  114. }
  115. }
  116. /**
  117. * Get id.
  118. *
  119. * @return int
  120. */
  121. public function getId()
  122. {
  123. return $this->id;
  124. }
  125. /**
  126. * Set nom.
  127. *
  128. * @param string $nom
  129. */
  130. public function setNom($nom): static
  131. {
  132. $this->nom = $nom;
  133. return $this;
  134. }
  135. /**
  136. * Get nom.
  137. *
  138. * @return string
  139. */
  140. public function getNom()
  141. {
  142. return $this->nom;
  143. }
  144. /**
  145. * Set population.
  146. *
  147. * @param int $population
  148. */
  149. public function setPopulation($population): static
  150. {
  151. $this->population = $population;
  152. return $this;
  153. }
  154. /**
  155. * Get population.
  156. *
  157. * @return int
  158. */
  159. public function getPopulation()
  160. {
  161. return $this->population;
  162. }
  163. /**
  164. * Set insee.
  165. *
  166. * @param string $insee
  167. */
  168. public function setInsee($insee): static
  169. {
  170. $this->insee = $insee;
  171. return $this;
  172. }
  173. /**
  174. * Get insee.
  175. *
  176. * @return string
  177. */
  178. public function getInsee()
  179. {
  180. return $this->insee;
  181. }
  182. /**
  183. * Set latitude.
  184. *
  185. * @param float $latitude
  186. */
  187. public function setLatitude($latitude): static
  188. {
  189. $this->latitude = $latitude;
  190. return $this;
  191. }
  192. /**
  193. * Get latitude.
  194. *
  195. * @return float
  196. */
  197. public function getLatitude()
  198. {
  199. return $this->latitude;
  200. }
  201. /**
  202. * Set longitude.
  203. *
  204. * @param float $longitude
  205. */
  206. public function setLongitude($longitude): static
  207. {
  208. $this->longitude = $longitude;
  209. return $this;
  210. }
  211. /**
  212. * Get longitude.
  213. *
  214. * @return float
  215. */
  216. public function getLongitude()
  217. {
  218. return $this->longitude;
  219. }
  220. /**
  221. * Add structuresImplementes.
  222. */
  223. public function addStructuresImplemente(Structure $structuresImplementes): static
  224. {
  225. $this->structuresImplementes[] = $structuresImplementes;
  226. return $this;
  227. }
  228. /**
  229. * Remove structuresImplementes.
  230. */
  231. public function removeStructuresImplemente(Structure $structuresImplementes): void
  232. {
  233. $this->structuresImplementes->removeElement($structuresImplementes);
  234. }
  235. /**
  236. * Get structuresImplementes.
  237. *
  238. * @return \Doctrine\Common\Collections\Collection
  239. */
  240. public function getStructuresImplementes()
  241. {
  242. return $this->structuresImplementes;
  243. }
  244. /**
  245. * Add structuresZoneInfluence.
  246. */
  247. public function addStructuresZoneInfluence(Structure $structuresZoneInfluence): static
  248. {
  249. $this->structuresZoneInfluence[] = $structuresZoneInfluence;
  250. return $this;
  251. }
  252. /**
  253. * Remove structuresZoneInfluence.
  254. */
  255. public function removeStructuresZoneInfluence(Structure $structuresZoneInfluence): void
  256. {
  257. $this->structuresZoneInfluence->removeElement($structuresZoneInfluence);
  258. }
  259. /**
  260. * Get structuresZoneInfluence.
  261. *
  262. * @return \Doctrine\Common\Collections\Collection
  263. */
  264. public function getStructuresZoneInfluence()
  265. {
  266. return $this->structuresZoneInfluence;
  267. }
  268. /**
  269. * Set departement.
  270. */
  271. public function setDepartement(?Departement $departement = null): static
  272. {
  273. $this->departement = $departement;
  274. return $this;
  275. }
  276. /**
  277. * Get departement.
  278. *
  279. * @return Departement
  280. */
  281. public function getDepartement()
  282. {
  283. return $this->departement;
  284. }
  285. /**
  286. * Set aucode.
  287. *
  288. * @param string $aucode
  289. */
  290. public function setAucode($aucode): static
  291. {
  292. $this->aucode = $aucode;
  293. return $this;
  294. }
  295. /**
  296. * Get aucode.
  297. *
  298. * @return string
  299. */
  300. public function getAucode()
  301. {
  302. return $this->aucode;
  303. }
  304. /**
  305. * Set aulibelle.
  306. *
  307. * @param string $aulibelle
  308. */
  309. public function setAulibelle($aulibelle): static
  310. {
  311. $this->aulibelle = $aulibelle;
  312. return $this;
  313. }
  314. /**
  315. * Get aulibelle.
  316. *
  317. * @return string
  318. */
  319. public function getAulibelle()
  320. {
  321. return $this->aulibelle;
  322. }
  323. /**
  324. * Set nom_insee.
  325. *
  326. * @param string $nomInsee
  327. */
  328. public function setNomInsee($nomInsee): static
  329. {
  330. $this->nom_insee = $nomInsee;
  331. return $this;
  332. }
  333. /**
  334. * Get nom_insee.
  335. *
  336. * @return string
  337. */
  338. public function getNomInsee()
  339. {
  340. return $this->nom_insee;
  341. }
  342. /**
  343. * Set codePostal.
  344. *
  345. * @param string $codePostal
  346. */
  347. public function setCodePostal($codePostal): static
  348. {
  349. $this->codePostal = $codePostal;
  350. return $this;
  351. }
  352. /**
  353. * Get codePostal.
  354. *
  355. * @return string
  356. */
  357. public function getCodePostal()
  358. {
  359. return $this->codePostal;
  360. }
  361. }