mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Feature: add a proper entity for geographical unit layer
This commit is contained in:
@@ -15,14 +15,14 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Table(name="chill_main_geographical_unit")
|
||||
* @ORM\Entity
|
||||
* @ORM\Entity(readOnly=true)
|
||||
*/
|
||||
class GeographicalUnit
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
private $geom;
|
||||
private string $geom;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
@@ -32,14 +32,19 @@ class GeographicalUnit
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
private $layerName;
|
||||
private string $unitName;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
private $unitName;
|
||||
private string $unitRefId;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=GeographicalUnitLayer::class)
|
||||
*/
|
||||
private ?GeographicalUnitLayer $layer;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
|
56
src/Bundle/ChillMainBundle/Entity/GeographicalUnitLayer.php
Normal file
56
src/Bundle/ChillMainBundle/Entity/GeographicalUnitLayer.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\MainBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Table(name="chill_main_geographical_unit_layer")
|
||||
* @ORM\Entity
|
||||
*/
|
||||
class GeographicalUnitLayer
|
||||
{
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="json", nullable=false, options={"default": "[]"})
|
||||
*/
|
||||
private array $name = [];
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
private string $refId = '';
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getName(): array
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $name
|
||||
* @return GeographicalUnitLayer
|
||||
*/
|
||||
public function setName(array $name): GeographicalUnitLayer
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user