public function __get($prop) { switch ($prop) { default: $underscoredProp = Utils::underscore($prop); if (isset($this->attributes[$underscoredProp])) { return $this->attributes[$underscoredProp]; } else { return; } } }
public function __set($prop, $value) { $underscoredProp = Utils::underscore($prop); $this->attributes[$underscoredProp] = $value; }