src/Entity/Setting.php line 18

Open in your IDE?
  1. <?php
  2.     namespace App\Entity;
  3.     use App\Repository\SettingRepository;
  4.     use App\Traits\DateTrait;
  5.     use Doctrine\ORM\Mapping as ORM;
  6.     use JMS\Serializer\Annotation as Serializer;
  7.     use JMS\Serializer\Annotation\Expose;
  8.     use JMS\Serializer\Annotation\Groups;
  9.     use JMS\Serializer\Annotation\SerializedName;
  10.     /**
  11.      * @ORM\Entity(repositoryClass=SettingRepository::class)
  12.      *
  13.      * @Serializer\ExclusionPolicy ("ALL")
  14.      */
  15.     class Setting
  16.     {
  17.         use DateTrait;
  18.         /**
  19.          * Identifiant de l'entité
  20.          *
  21.          * @ORM\Id
  22.          * @ORM\GeneratedValue
  23.          * @ORM\Column(type="integer")
  24.          *
  25.          * @Expose
  26.          * @Groups ({"setting"})
  27.          */
  28.         private ?int $id NULL;
  29.         /**
  30.          * Nom du paramètre
  31.          *
  32.          * @ORM\Column(type="string", length=255, unique=true)
  33.          *
  34.          * @Expose
  35.          * @Groups ({"setting"})
  36.          */
  37.         private ?string $name NULL;
  38.         /**
  39.          * Valeur du paramètre
  40.          *
  41.          * @ORM\Column(type="text", nullable=true)
  42.          *
  43.          * @Expose
  44.          * @Groups ({"setting"})
  45.          */
  46.         private ?string $value NULL;
  47.         /**
  48.          * Description du paramètre
  49.          *
  50.          * @ORM\Column(type="text")
  51.          *
  52.          * @Expose
  53.          * @Groups ({"setting"})
  54.          */
  55.         private ?string $description NULL;
  56.         /**
  57.          * Type de champ
  58.          *
  59.          * @ORM\Column(type="string", length=30)
  60.          */
  61.         private ?string $fieldType NULL;
  62.         /**
  63.          * Titre du paramètre
  64.          *
  65.          * @ORM\Column(type="string", length=128, nullable=true)
  66.          *
  67.          * @Expose
  68.          * @Groups ({"setting"})
  69.          */
  70.         private ?string $title NULL;
  71.         /**
  72.          * @Serializer\VirtualProperty()
  73.          * @SerializedName ("title_description")
  74.          * @Groups ({"setting"})
  75.          *
  76.          * @return array
  77.          */
  78.         public function getNameDescription()
  79.         {
  80.             return [$this->title$this->description];
  81.         }
  82.         public function getId(): ?int
  83.         {
  84.             return $this->id;
  85.         }
  86.         public function getName(): ?string
  87.         {
  88.             return $this->name;
  89.         }
  90.         public function setName(string $name): self
  91.         {
  92.             $this->name $name;
  93.             return $this;
  94.         }
  95.         public function getValue(): ?string
  96.         {
  97.             return $this->value;
  98.         }
  99.         public function setValue(?string $value): self
  100.         {
  101.             $this->value $value;
  102.             return $this;
  103.         }
  104.         public function getDescription(): ?string
  105.         {
  106.             return $this->description;
  107.         }
  108.         public function setDescription(string $description): self
  109.         {
  110.             $this->description $description;
  111.             return $this;
  112.         }
  113.         public function getFieldType(): ?string
  114.         {
  115.             return $this->fieldType;
  116.         }
  117.         public function setFieldType(string $fieldType): self
  118.         {
  119.             $this->fieldType $fieldType;
  120.             return $this;
  121.         }
  122.         public function getTitle(): ?string
  123.         {
  124.             return $this->title;
  125.         }
  126.         public function setTitle(?string $title): self
  127.         {
  128.             $this->title $title;
  129.             return $this;
  130.         }
  131.     }