<?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\DataFieldRepository")
*/
class DataField
{
/**
* @ORM\Id()
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator(class="App\Doctrine\CustomIdGenerator")
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\DataEntity", inversedBy="fields")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="data_entity_id", referencedColumnName="id", onDelete="CASCADE")
* })
*/
private $dataEntity;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom affiché"})
*/
private $label;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom de la propriété doctrine = nom tag dans le flux json (oldapi)"})
*/
private $name;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom du champ dans la table en BDD - est-ce utile ?"})
*/
private $tableFieldName;
/**
* @ORM\Column(type="boolean", nullable=true, options={"comment":"True si le champ est utilisé pour filtrer (dans sélection)"})
*/
private $isForFilter;
/**
* @ORM\Column(type="boolean", nullable=true, options={"comment":"True si le champ est utilisé pour l'affochage dans les blocs)"})
*/
private $isForDisplay;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom du tag de filtre (liste des tags : genre, cat, typ, hor, gps, critseul, crimod OU {ALIAS].[FIELD] : pro.productCode, pro.city, ..."})
*/
private $filterTag;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Exemple d'affichage en texte pour les écrans de gestion"})
*/
private $displayExample;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom groupe de filtre (dans Sélection)"})
*/
private $filterGroupName;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom groupe d'affichage (dans blocs)"})
*/
private $displayGroupName;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $displayOrder;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\WebSort", mappedBy="field", cascade={"persist"})
*/
private $sorts;
/**
* @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\Column(type="string", length=255, options={"default": "text"})
*/
private $type;
public function __construct()
{
$this->sorts = new ArrayCollection();
}
public function getId() : ?int
{
return $this->id;
}
public function getLabel() : ?string
{
return $this->label;
}
public function setLabel(?string $label) : self
{
$this->label = $label;
return $this;
}
public function getName() : ?string
{
return $this->name;
}
public function setName(?string $name) : self
{
$this->name = $name;
return $this;
}
public function getTableFieldName() : ?string
{
return $this->tableFieldName;
}
public function setTableFieldName(?string $tableFieldName) : self
{
$this->tableFieldName = $tableFieldName;
return $this;
}
public function getIsForFilter() : ?bool
{
return $this->isForFilter;
}
public function setIsForFilter(?bool $isForFilter) : self
{
$this->isForFilter = $isForFilter;
return $this;
}
public function getFilterGroupName() : ?string
{
return $this->filterGroupName;
}
public function setFilterGroupName(?string $filterGroupName) : self
{
$this->filterGroupName = $filterGroupName;
return $this;
}
public function getDisplayGroupName() : ?string
{
return $this->displayGroupName;
}
public function setDisplayGroupName(?string $displayGroupName) : self
{
$this->displayGroupName = $displayGroupName;
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;
}
public function getDataEntity() : ?DataEntity
{
return $this->dataEntity;
}
public function setDataEntity(?DataEntity $dataEntity) : self
{
$this->dataEntity = $dataEntity;
return $this;
}
/**
* @return Collection|WebSort[]
*/
public function getSorts() : Collection
{
return $this->sorts;
}
public function addSort(WebSort $sort) : self
{
if (!$this->sorts->contains($sort)) {
$this->sorts[] = $sort;
$sort->setField($this);
}
return $this;
}
public function removeSort(WebSort $sort) : self
{
if ($this->sorts->contains($sort)) {
$this->sorts->removeElement($sort);
// set the owning side to null (unless already changed)
if ($sort->getField() === $this) {
$sort->setField(null);
}
}
return $this;
}
public function getDisplayOrder() : ?int
{
return $this->displayOrder;
}
public function setDisplayOrder(?int $displayOrder) : self
{
$this->displayOrder = $displayOrder;
return $this;
}
public function getFilterTag() : ?string
{
return $this->filterTag;
}
public function setFilterTag(?string $filterTag) : self
{
$this->filterTag = $filterTag;
return $this;
}
public function getDisplayExample() : ?string
{
return $this->displayExample;
}
public function setDisplayExample(?string $displayExample) : self
{
$this->displayExample = $displayExample;
return $this;
}
public function getIsForDisplay() : ?bool
{
return $this->isForDisplay;
}
public function setIsForDisplay(?bool $isForDisplay) : self
{
$this->isForDisplay = $isForDisplay;
return $this;
}
public function getType() : ?string
{
return $this->type;
}
public function setType(string $type) : self
{
$this->type = $type;
return $this;
}
}