Esempio n. 1
0
 /**
  * @inheritdoc
  */
 public function __get($name)
 {
     if ($name == "value") {
         if ($this->raw_data) {
             return implode(" ", $this->raw_data);
         }
         if ($this->data instanceof Carbon) {
             return $this->data->formatLocalized(str_replace("%s", "%S", str_replace("%i", "%M", $this->format)));
         } elseif ($this->data instanceof \DateTime) {
             return Carbon::instance($this->data)->formatLocalized(str_replace("%s", "%S", str_replace("%i", "%M", $this->format)));
         } else {
             return '';
             // @codeCoverageIgnore
         }
     }
     return parent::__get($name);
     // @codeCoverageIgnore
 }
Esempio n. 2
0
 /**
  * @inheritdoc
  */
 public function __get($name)
 {
     if ($name == "options") {
         $this->options = [];
         $opts = ['widget' => $this->option_widget, 'name' => $this->name, 'form' => $this->form, 'meta' => $this->meta];
         $i = 0;
         foreach ($this->getChoices() as list($value, $label, $selected)) {
             $opts['id'] = "{$this->id}-{$i}";
             $opts['label'] = $label;
             $i++;
             $opt = new _Option($opts);
             $opt->process([], $value);
             $opt->checked = $selected;
             $this->options[] = $opt;
         }
         return $this->options;
     }
     return parent::__get($name);
     // @codeCoverageIgnore
 }
Esempio n. 3
0
 /**
  * @inheritdoc
  */
 public function __get($name)
 {
     if (in_array($name, ["data", "errors"]) || property_exists($this->form, $name)) {
         return $this->form->{$name};
     }
     if (array_key_exists($name, $this->form->fields)) {
         return $this->form[$name];
     }
     return parent::__get($name);
     // @codeCoverageIgnore
 }
Esempio n. 4
0
 /**
  * @inheritdoc
  */
 public function __get($name)
 {
     if ($name == "data") {
         $ret = [];
         foreach ($this->entries as $entry) {
             $ret[] = $entry->data;
         }
         return $ret;
     }
     return parent::__get($name);
     //@codeCoverageIgnore
 }