src/Entity/Gos/Uniqskills/Landing/LandingModuleBoolean.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos\Uniqskills\Landing;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity()
  6.  */
  7. class LandingModuleBoolean extends LandingModuleItem
  8. {
  9.     /**
  10.      * @param boolean $variableValue
  11.      *
  12.      * @return LandingModuleBoolean
  13.      * @throws \Exception
  14.      */
  15.     public function setVariableValue($variableValue)
  16.     {
  17.         if (is_bool($variableValue))
  18.         {
  19.             $this->variableValue $variableValue;
  20.             return $this;
  21.         }
  22.         throw new \Exception('Not boolean');
  23.     }
  24.     /**
  25.      * @return string|null
  26.      */
  27.     public function getVariableValue()
  28.     {
  29.         //parse string from database to boolean
  30.         return filter_var($this->variableValueFILTER_VALIDATE_BOOLEAN);
  31.     }
  32.     /**
  33.      * @return string
  34.      */
  35.     public function getVariableType()
  36.     {
  37.         return $this::VARIABLE_TYPE_BOOLEAN;
  38.     }
  39. }