/** * @param string $key * * @return string */ public function get_attribute($key) { switch ($key) { case 'type': return $this->type; case 'value': if (!empty($this->value)) { return $this->value; } return $this->default_value; default: return $this->attributes->get_attribute($key); } }
public function get_id() { return $this->attributes->get_attribute('id'); }