$prop)) { return $this->$prop; } return $def; } public function set($prop, $value = null) { $prev = isset($this->$prop) ? $this->$prop : null; $this->$prop = $value; return $prev; } public function setProperties($props) { if (is_array($props) || is_object($props)) { foreach ( $props as $k => $v) { $this->{$k} = $v; } return true; } else { return false; } } }