src/Entity/DataField.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\DataFieldRepository")
  8.  */
  9. class DataField
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue(strategy="CUSTOM")
  14.      * @ORM\CustomIdGenerator(class="App\Doctrine\CustomIdGenerator")
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity="App\Entity\DataEntity", inversedBy="fields")
  20.      * @ORM\JoinColumns({
  21.      *   @ORM\JoinColumn(name="data_entity_id", referencedColumnName="id", onDelete="CASCADE")
  22.      * })
  23.      */
  24.     private $dataEntity;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom affiché"})
  27.      */
  28.     private $label;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom de la propriété doctrine = nom tag dans le flux json (oldapi)"})
  31.      */
  32.     private $name;
  33.     /**
  34.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom du champ dans la table en BDD - est-ce utile ?"})
  35.      */
  36.     private $tableFieldName;
  37.     /**
  38.      * @ORM\Column(type="boolean", nullable=true, options={"comment":"True si le champ est utilisé pour filtrer (dans sélection)"})
  39.      */
  40.     private $isForFilter;
  41.     /**
  42.      * @ORM\Column(type="boolean", nullable=true, options={"comment":"True si le champ est utilisé pour l'affochage dans les blocs)"})
  43.      */
  44.     private $isForDisplay;
  45.     /**
  46.      * @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, ..."})
  47.      */
  48.     private $filterTag;
  49.     /**
  50.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Exemple d'affichage en texte pour les écrans de gestion"})
  51.      */
  52.     private $displayExample;
  53.     /**
  54.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom groupe de filtre (dans Sélection)"})
  55.      */
  56.     private $filterGroupName;
  57.     /**
  58.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom groupe d'affichage (dans blocs)"})
  59.      */
  60.     private $displayGroupName;
  61.     /**
  62.      * @ORM\Column(type="integer", nullable=true)
  63.      */
  64.     private $displayOrder;
  65.     /**
  66.      * @var \Doctrine\Common\Collections\Collection
  67.      *
  68.      * @ORM\OneToMany(targetEntity="App\Entity\WebSort", mappedBy="field", cascade={"persist"})
  69.      */
  70.     private $sorts;
  71.     /**
  72.      * @ORM\Column(type="datetime", nullable=true)
  73.      */
  74.     private $createdAt;
  75.     /**
  76.      * @ORM\Column(type="datetime", nullable=true)
  77.      */
  78.     private $updatedAt;
  79.     /**
  80.      * @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
  81.      */
  82.     private $state;
  83.     /**
  84.      * @ORM\Column(type="string", length=255, options={"default": "text"})
  85.      */
  86.     private $type;
  87.     public function __construct()
  88.     {
  89.         $this->sorts = new ArrayCollection();
  90.     }
  91.     public function getId() : ?int
  92.     {
  93.         return $this->id;
  94.     }
  95.     public function getLabel() : ?string
  96.     {
  97.         return $this->label;
  98.     }
  99.     public function setLabel(?string $label) : self
  100.     {
  101.         $this->label $label;
  102.         return $this;
  103.     }
  104.     public function getName() : ?string
  105.     {
  106.         return $this->name;
  107.     }
  108.     public function setName(?string $name) : self
  109.     {
  110.         $this->name $name;
  111.         return $this;
  112.     }
  113.     public function getTableFieldName() : ?string
  114.     {
  115.         return $this->tableFieldName;
  116.     }
  117.     public function setTableFieldName(?string $tableFieldName) : self
  118.     {
  119.         $this->tableFieldName $tableFieldName;
  120.         return $this;
  121.     }
  122.     public function getIsForFilter() : ?bool
  123.     {
  124.         return $this->isForFilter;
  125.     }
  126.     public function setIsForFilter(?bool $isForFilter) : self
  127.     {
  128.         $this->isForFilter $isForFilter;
  129.         return $this;
  130.     }
  131.     public function getFilterGroupName() : ?string
  132.     {
  133.         return $this->filterGroupName;
  134.     }
  135.     public function setFilterGroupName(?string $filterGroupName) : self
  136.     {
  137.         $this->filterGroupName $filterGroupName;
  138.         return $this;
  139.     }
  140.     public function getDisplayGroupName() : ?string
  141.     {
  142.         return $this->displayGroupName;
  143.     }
  144.     public function setDisplayGroupName(?string $displayGroupName) : self
  145.     {
  146.         $this->displayGroupName $displayGroupName;
  147.         return $this;
  148.     }
  149.     public function getCreatedAt() : ?\DateTimeInterface
  150.     {
  151.         return $this->createdAt;
  152.     }
  153.     public function setCreatedAt(?\DateTimeInterface $createdAt) : self
  154.     {
  155.         $this->createdAt $createdAt;
  156.         return $this;
  157.     }
  158.     public function getUpdatedAt() : ?\DateTimeInterface
  159.     {
  160.         return $this->updatedAt;
  161.     }
  162.     public function setUpdatedAt(?\DateTimeInterface $updatedAt) : self
  163.     {
  164.         $this->updatedAt $updatedAt;
  165.         return $this;
  166.     }
  167.     public function getState() : ?int
  168.     {
  169.         return $this->state;
  170.     }
  171.     public function setState(?int $state) : self
  172.     {
  173.         $this->state $state;
  174.         return $this;
  175.     }
  176.     public function getDataEntity() : ?DataEntity
  177.     {
  178.         return $this->dataEntity;
  179.     }
  180.     public function setDataEntity(?DataEntity $dataEntity) : self
  181.     {
  182.         $this->dataEntity $dataEntity;
  183.         return $this;
  184.     }
  185.     /**
  186.      * @return Collection|WebSort[]
  187.      */
  188.     public function getSorts() : Collection
  189.     {
  190.         return $this->sorts;
  191.     }
  192.     public function addSort(WebSort $sort) : self
  193.     {
  194.         if (!$this->sorts->contains($sort)) {
  195.             $this->sorts[] = $sort;
  196.             $sort->setField($this);
  197.         }
  198.         return $this;
  199.     }
  200.     public function removeSort(WebSort $sort) : self
  201.     {
  202.         if ($this->sorts->contains($sort)) {
  203.             $this->sorts->removeElement($sort);
  204.             // set the owning side to null (unless already changed)
  205.             if ($sort->getField() === $this) {
  206.                 $sort->setField(null);
  207.             }
  208.         }
  209.         return $this;
  210.     }
  211.     public function getDisplayOrder() : ?int
  212.     {
  213.         return $this->displayOrder;
  214.     }
  215.     public function setDisplayOrder(?int $displayOrder) : self
  216.     {
  217.         $this->displayOrder $displayOrder;
  218.         return $this;
  219.     }
  220.     public function getFilterTag() : ?string
  221.     {
  222.         return $this->filterTag;
  223.     }
  224.     public function setFilterTag(?string $filterTag) : self
  225.     {
  226.         $this->filterTag $filterTag;
  227.         return $this;
  228.     }
  229.     public function getDisplayExample() : ?string
  230.     {
  231.         return $this->displayExample;
  232.     }
  233.     public function setDisplayExample(?string $displayExample) : self
  234.     {
  235.         $this->displayExample $displayExample;
  236.         return $this;
  237.     }
  238.     public function getIsForDisplay() : ?bool
  239.     {
  240.         return $this->isForDisplay;
  241.     }
  242.     public function setIsForDisplay(?bool $isForDisplay) : self
  243.     {
  244.         $this->isForDisplay $isForDisplay;
  245.         return $this;
  246.     }
  247.     public function getType() : ?string
  248.     {
  249.         return $this->type;
  250.     }
  251.     public function setType(string $type) : self
  252.     {
  253.         $this->type $type;
  254.         return $this;
  255.     }
  256. }