src/Entity/WebsiteParams/ModuleParams.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity\WebsiteParams;
  3. use App\Repository\WebsiteParams\ModuleParamsRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * @ORM\Entity(repositoryClass=ModuleParamsRepository::class)
  8.  */
  9. class ModuleParams extends WebsiteParams
  10. {
  11.     public const INTEGER 'integer';
  12.     public const STRING 'string';
  13.     public const BOOLEAN 'boolean';
  14.     public const MODULE_SLIDER 'module_slider';
  15.     public const MODULE_STRATE 'module_strate';
  16.     public const MODULE_PUNTOS 'module_puntos';
  17.     public const MODULE_GODPARENT 'module_godparent';
  18.     public const MODULE_ARRAY = [
  19.         self::MODULE_SLIDER,
  20.         self::MODULE_STRATE,
  21.         self::MODULE_PUNTOS,
  22.         self::MODULE_GODPARENT,
  23.     ];
  24.     public const FIELDS_STRATE = [
  25.         'puntos_to_reach' => self::BOOLEAN,
  26.     ];
  27.     public const FIELDS_PUNTOS = [
  28.         'type' => [
  29.             'item' => self::BOOLEAN,
  30.             'amount' => self::BOOLEAN,
  31.         ],
  32.         'point' => self::INTEGER,
  33.     ];
  34.     public const FIELDS_GODPARENT = [
  35.         'point' => self::INTEGER,
  36.     ];
  37.     public const FIELDS_MODULE = [
  38.         self::MODULE_STRATE => self::FIELDS_STRATE,
  39.         self::MODULE_PUNTOS => self::FIELDS_PUNTOS,
  40.         self::MODULE_GODPARENT => self::FIELDS_GODPARENT,
  41.     ];
  42.     /**
  43.      * @ORM\Column(type="string", length=255)
  44.      * @Assert\Choice(
  45.      *     choices=ModuleParams::MODULE_ARRAY,
  46.      *     message="Choisissez un module valide."
  47.      * )
  48.      */
  49.     private $type;
  50.     /**
  51.      * @ORM\Column(type="datetime", options={"default": "CURRENT_TIMESTAMP"})
  52.      */
  53.     private $startDate;
  54.     /**
  55.      * @ORM\Column(type="datetime", options={"default": "CURRENT_TIMESTAMP"}, nullable=true)
  56.      */
  57.     private $endDate;
  58.     /**
  59.      * @ORM\Column(type="boolean", options={"default": 0})
  60.      */
  61.     private bool $online false;
  62.     /**
  63.      * @ORM\Column(type="array", nullable=true)
  64.      */
  65.     private $extraConfig;
  66.     public function getType(): ?string
  67.     {
  68.         return $this->type;
  69.     }
  70.     public function setType(string $type): self
  71.     {
  72.         $this->type $type;
  73.         return $this;
  74.     }
  75.     public function getStartDate()
  76.     {
  77.         return $this->startDate;
  78.     }
  79.     public function setStartDate($startDate): ModuleParams
  80.     {
  81.         $this->startDate $startDate;
  82.         return $this;
  83.     }
  84.     public function getEndDate()
  85.     {
  86.         return $this->endDate;
  87.     }
  88.     public function setEndDate($endDate): ModuleParams
  89.     {
  90.         $this->endDate $endDate;
  91.         return $this;
  92.     }
  93.     public function isOnline(): bool
  94.     {
  95.         return $this->online;
  96.     }
  97.     public function setOnline(bool $online): ModuleParams
  98.     {
  99.         $this->online $online;
  100.         return $this;
  101.     }
  102.     public function getExtraConfig()
  103.     {
  104.         return $this->extraConfig;
  105.     }
  106.     public function setExtraConfig($extraConfig)
  107.     {
  108.         $this->extraConfig $extraConfig;
  109.         return $this;
  110.     }
  111. }