/** * Override parent getter to call getResults() if data hasn't been populated * @param string $key */ public function __get($key) { if ($key == 'data' && empty($this->options['data']) && isset($this->relation)) { $this->options['data'] = $this->relation->getResults(); } return parent::__get($key); }
public function __construct($name, $data, $options = array()) { parent::__construct($name, $data, $options); // add a class for javascript to attach $this->attributes['class'][] = 'pt-colorpicker'; }
public function __construct($name, $data, $options = array()) { // Add another reserved attribute for file fieldtype array_push($this->reserved, 'directory'); parent::__construct($name, $data, $options); }