src/Model/Document/Editable/ColorPicker.php line 5

Open in your IDE?
  1. <?php
  2. namespace App\Model\Document\Editable;
  3. class ColorPicker extends \Pimcore\Model\Document\Editable
  4. {
  5.     protected $value;
  6.     /**
  7.      * Used to get data to js file (initialize method)
  8.      */
  9.     public function frontend()
  10.     {
  11.         return $this->getData();
  12.     }
  13.     public function getData()
  14.     {
  15.         return $this->value;
  16.     }
  17.     /**
  18.      * Returns type, has to be the same as in js and yaml file
  19.      */
  20.     public function getType()
  21.     {
  22.         return 'color_picker';
  23.     }
  24.     /**
  25.      * Used for getting data from editmode
  26.      */
  27.     public function setDataFromEditmode($data)
  28.     {
  29.         $this->value $data;
  30.         return $this;
  31.     }
  32.     /**
  33.      * Used for getting data from database
  34.      */
  35.     public function setDataFromResource($data)
  36.     {
  37.         $this->value $data;
  38.         return $this;
  39.     }
  40.     public function isEmpty()
  41.     {
  42.         return empty($this->value);
  43.     }
  44. }