src/Entity/DataEntity.php line 11

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.  * @ORM\Entity (repositoryClass="App\Repository\DataEntityRepository")
  8.  */
  9. class DataEntity
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom de la classe doctrine"})
  19.      */
  20.     private $name;
  21.     /**
  22.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom de la table en BDD"})
  23.      */
  24.     private $tableName;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Alias utilisé dans les requetes de olapi"})
  27.      */
  28.     private $alias;
  29.     /**
  30.      * @var \Doctrine\Common\Collections\Collection
  31.      *
  32.      * @ORM\OneToMany(targetEntity="App\Entity\DataField", mappedBy="dataEntity", cascade={"persist","remove"})
  33.      */
  34.     private $fields;
  35.     /**
  36.      * @ORM\Column(type="datetime", nullable=true)
  37.      */
  38.     private $createdAt;
  39.     /**
  40.      * @ORM\Column(type="datetime", nullable=true)
  41.      */
  42.     private $updatedAt;
  43.     /**
  44.      * @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
  45.      */
  46.     private $state;
  47.     public function __construct()
  48.     {
  49.         $this->fields = new ArrayCollection();
  50.     }
  51.     public function getId() : ?int
  52.     {
  53.         return $this->id;
  54.     }
  55.     public function getName() : ?string
  56.     {
  57.         return $this->name;
  58.     }
  59.     public function setName(?string $name) : self
  60.     {
  61.         $this->name $name;
  62.         return $this;
  63.     }
  64.     public function getTableName() : ?string
  65.     {
  66.         return $this->tableName;
  67.     }
  68.     public function setTableName(?string $tableName) : self
  69.     {
  70.         $this->tableName $tableName;
  71.         return $this;
  72.     }
  73.     public function getCreatedAt() : ?\DateTimeInterface
  74.     {
  75.         return $this->createdAt;
  76.     }
  77.     public function setCreatedAt(?\DateTimeInterface $createdAt) : self
  78.     {
  79.         $this->createdAt $createdAt;
  80.         return $this;
  81.     }
  82.     public function getUpdatedAt() : ?\DateTimeInterface
  83.     {
  84.         return $this->updatedAt;
  85.     }
  86.     public function setUpdatedAt(?\DateTimeInterface $updatedAt) : self
  87.     {
  88.         $this->updatedAt $updatedAt;
  89.         return $this;
  90.     }
  91.     public function getState() : ?int
  92.     {
  93.         return $this->state;
  94.     }
  95.     public function setState(?int $state) : self
  96.     {
  97.         $this->state $state;
  98.         return $this;
  99.     }
  100.     /**
  101.      * @return Collection|DataField[]
  102.      */
  103.     public function getFields() : Collection
  104.     {
  105.         return $this->fields;
  106.     }
  107.     public function addField(DataField $field) : self
  108.     {
  109.         if (!$this->fields->contains($field)) {
  110.             $this->fields[] = $field;
  111.             $field->setDataEntity($this);
  112.         }
  113.         return $this;
  114.     }
  115.     public function removeField(DataField $field) : self
  116.     {
  117.         if ($this->fields->contains($field)) {
  118.             $this->fields->removeElement($field);
  119.             // set the owning side to null (unless already changed)
  120.             if ($field->getDataEntity() === $this) {
  121.                 $field->setDataEntity(null);
  122.             }
  123.         }
  124.         return $this;
  125.     }
  126.     public function getAlias() : ?string
  127.     {
  128.         return $this->alias;
  129.     }
  130.     public function setAlias(?string $alias) : self
  131.     {
  132.         $this->alias $alias;
  133.         return $this;
  134.     }
  135. }