/** * Magic function __get returns properties for this object, or passes it on to the parent class * Potential valid properties: * tmp_file: The uploaded file * * @param string $name The parameter to retrieve * @return mixed The value of the parameter * */ public function __get($name) { switch ($name) { case 'tmp_file': return $_FILES[$this->field]['tmp_name']; default: return parent::__get($name); } }
/** * Magic __get method for returning property values * Override the handling of the value property to properly return the setting of the checkbox. * * @param string $name The name of the property * @return mixed The value of the requested property */ public function __get($name) { switch ($name) { case 'value': if (isset($_POST[$this->field . '_submitted'])) { if (isset($_POST[$this->field])) { return true; } else { return false; } } else { return $this->get_default(); } } return parent::__get($name); }