src/Entity/BlockField.php line 12

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\BlockFieldRepository")
  8.  */
  9. class BlockField
  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)
  19.      */
  20.     private $name;
  21.     /**
  22.      * @ORM\Column(type="integer", nullable=true)
  23.      */
  24.     private $ordering;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity="App\Entity\Block", inversedBy="fields")
  27.      * @ORM\JoinColumns({
  28.      *   @ORM\JoinColumn(name="block_id", referencedColumnName="id", onDelete="CASCADE")
  29.      * })
  30.      */
  31.     private $block;
  32.     /**
  33.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Intitulé ou préfixe"})
  34.      */
  35.     private $label;
  36.     /**
  37.      * @ORM\Column(type="json", nullable=true)
  38.      */
  39.     private $labelTranslations;
  40.     /**
  41.      * @ORM\Column(type="json", nullable=true, options={"comment":"Icône CSS type fontAwesome"})
  42.      */
  43.     private $iconClass;
  44.     /**
  45.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Classe CSS du champ"})
  46.      */
  47.     private $CSSClass;
  48.     /**
  49.      * @ORM\Column(type="json", nullable=true, options={"comment":"Largeur du champ (type 1-3 1-2@m 1-1@s)"})
  50.      */
  51.     private $fieldWidth;
  52.     /**
  53.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"COLUMNS ou ARRAY ou INLINE"})
  54.      */
  55.     private $itemsDisplayType;
  56.     /**
  57.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Texte de séparation entre enfants en mode INLINE"})
  58.      */
  59.     private $itemsSeparator;
  60.     /**
  61.      * @ORM\Column(type="json", nullable=true, options={"comment":"Clase CSS d'icône pour les enfants (type FontAwesome)"})
  62.      */
  63.     private $itemsIconClass;
  64.     /**
  65.      * @ORM\Column(type="json", nullable=true, options={"comment":"Nombre de colonnes des items (type 4@xl 2@m 1@s)"})
  66.      */
  67.     private $itemsColumns;
  68.     /**
  69.      * @var \Doctrine\Common\Collections\Collection
  70.      *
  71.      * @ORM\OneToMany(targetEntity="App\Entity\BlockFieldItem", mappedBy="blockField", cascade={"persist","remove"}, orphanRemoval=true)
  72.      * @ORM\OrderBy({"ordering" = "ASC"})
  73.      */
  74.     private $items;
  75.     /**
  76.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="blockFields")
  77.      * @ORM\JoinColumns({
  78.      *   @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
  79.      * })
  80.      */
  81.     private $owner;
  82.     /**
  83.      * @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="blockFields")
  84.      * @ORM\JoinColumns({
  85.      *   @ORM\JoinColumn(name="entity_id", referencedColumnName="id")
  86.      * })
  87.      */
  88.     private $entity;
  89.     /**
  90.      * @ORM\Column(type="datetime", nullable=true)
  91.      */
  92.     private $createdAt;
  93.     /**
  94.      * @ORM\Column(type="datetime", nullable=true)
  95.      */
  96.     private $updatedAt;
  97.     /**
  98.      * @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
  99.      */
  100.     private $state;
  101.     public function __construct()
  102.     {
  103.         $this->items = new ArrayCollection();
  104.     }
  105.     public function getId() : ?int
  106.     {
  107.         return $this->id;
  108.     }
  109.     public function getName() : ?string
  110.     {
  111.         return $this->name;
  112.     }
  113.     public function setName(?string $name) : self
  114.     {
  115.         $this->name $name;
  116.         return $this;
  117.     }
  118.     public function getLabel() : ?string
  119.     {
  120.         return $this->label;
  121.     }
  122.     public function setLabel(?string $label) : self
  123.     {
  124.         $this->label $label;
  125.         return $this;
  126.     }
  127.     public function getLabelTranslations() : ?array
  128.     {
  129.         return $this->labelTranslations;
  130.     }
  131.     public function setLabelTranslations(?array $labelTranslations) : self
  132.     {
  133.         $this->labelTranslations $labelTranslations;
  134.         return $this;
  135.     }
  136.     public function getIconClass() : ?array
  137.     {
  138.         return $this->iconClass;
  139.     }
  140.     public function setIconClass(?array $iconClass) : self
  141.     {
  142.         $this->iconClass $iconClass;
  143.         return $this;
  144.     }
  145.     public function getCSSClass() : ?string
  146.     {
  147.         return $this->CSSClass;
  148.     }
  149.     public function setCSSClass(?string $CSSClass) : self
  150.     {
  151.         $this->CSSClass $CSSClass;
  152.         return $this;
  153.     }
  154.     public function getFieldWidth() : ?array
  155.     {
  156.         return $this->fieldWidth;
  157.     }
  158.     public function setFieldWidth(?array $fieldWidth) : self
  159.     {
  160.         $this->fieldWidth $fieldWidth;
  161.         return $this;
  162.     }
  163.     public function getItemsDisplayType() : ?string
  164.     {
  165.         return $this->itemsDisplayType;
  166.     }
  167.     public function setItemsDisplayType(?string $itemsDisplayType) : self
  168.     {
  169.         $this->itemsDisplayType $itemsDisplayType;
  170.         return $this;
  171.     }
  172.     public function getItemsSeparator() : ?string
  173.     {
  174.         return $this->itemsSeparator;
  175.     }
  176.     public function setItemsSeparator(?string $itemsSeparator) : self
  177.     {
  178.         $this->itemsSeparator $itemsSeparator;
  179.         return $this;
  180.     }
  181.     public function getItemsIconClass() : ?array
  182.     {
  183.         return $this->itemsIconClass;
  184.     }
  185.     public function setItemsIconClass(?array $itemsIconClass) : self
  186.     {
  187.         $this->itemsIconClass $itemsIconClass;
  188.         return $this;
  189.     }
  190.     public function getItemsColumns() : ?array
  191.     {
  192.         return $this->itemsColumns;
  193.     }
  194.     public function setItemsColumns(?array $itemsColumns) : self
  195.     {
  196.         $this->itemsColumns $itemsColumns;
  197.         return $this;
  198.     }
  199.     public function getCreatedAt() : ?\DateTimeInterface
  200.     {
  201.         return $this->createdAt;
  202.     }
  203.     public function setCreatedAt(?\DateTimeInterface $createdAt) : self
  204.     {
  205.         $this->createdAt $createdAt;
  206.         return $this;
  207.     }
  208.     public function getUpdatedAt() : ?\DateTimeInterface
  209.     {
  210.         return $this->updatedAt;
  211.     }
  212.     public function setUpdatedAt(?\DateTimeInterface $updatedAt) : self
  213.     {
  214.         $this->updatedAt $updatedAt;
  215.         return $this;
  216.     }
  217.     public function getState() : ?int
  218.     {
  219.         return $this->state;
  220.     }
  221.     public function setState(?int $state) : self
  222.     {
  223.         $this->state $state;
  224.         return $this;
  225.     }
  226.     public function getBlock() : ?Block
  227.     {
  228.         return $this->block;
  229.     }
  230.     public function setBlock(?Block $block) : self
  231.     {
  232.         $this->block $block;
  233.         return $this;
  234.     }
  235.     /**
  236.      * @return Collection|BlockFieldItem[]
  237.      */
  238.     public function getItems() : Collection
  239.     {
  240.         return $this->items;
  241.     }
  242.     public function addItem(BlockFieldItem $item) : self
  243.     {
  244.         if (!$this->items->contains($item)) {
  245.             $this->items[] = $item;
  246.             $item->setBlockField($this);
  247.         }
  248.         return $this;
  249.     }
  250.     public function removeItem(BlockFieldItem $item) : self
  251.     {
  252.         if ($this->items->contains($item)) {
  253.             $this->items->removeElement($item);
  254.             // set the owning side to null (unless already changed)
  255.             if ($item->getBlockField() === $this) {
  256.                 $item->setBlockField(null);
  257.             }
  258.         }
  259.         return $this;
  260.     }
  261.     public function getOwner() : ?User
  262.     {
  263.         return $this->owner;
  264.     }
  265.     public function setOwner(?User $owner) : self
  266.     {
  267.         $this->owner $owner;
  268.         return $this;
  269.     }
  270.     public function getEntity() : ?DnsitEntity
  271.     {
  272.         return $this->entity;
  273.     }
  274.     public function setEntity(?DnsitEntity $entity) : self
  275.     {
  276.         $this->entity $entity;
  277.         return $this;
  278.     }
  279.     public function getOrdering() : ?int
  280.     {
  281.         return $this->ordering;
  282.     }
  283.     public function setOrdering(int $ordering) : self
  284.     {
  285.         $this->ordering $ordering;
  286.         return $this;
  287.     }
  288. }