<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity (repositoryClass="App\Repository\DataEntityRepository")
*/
class DataEntity
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom de la classe doctrine"})
*/
private $name;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom de la table en BDD"})
*/
private $tableName;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Alias utilisé dans les requetes de olapi"})
*/
private $alias;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\DataField", mappedBy="dataEntity", cascade={"persist","remove"})
*/
private $fields;
/**
* @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;
public function __construct()
{
$this->fields = 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 getTableName() : ?string
{
return $this->tableName;
}
public function setTableName(?string $tableName) : self
{
$this->tableName = $tableName;
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;
}
}