| @@ 49-58 (lines=10) @@ | ||
| 46 | return str_replace('_', '', ucwords($str, '_')); |
|
| 47 | } |
|
| 48 | ||
| 49 | public function __set($name, $value) |
|
| 50 | { |
|
| 51 | $c = $this->camelize($name); |
|
| 52 | $m = "set$c"; |
|
| 53 | if (method_exists($this, $m)) { |
|
| 54 | return $this->$m($value); |
|
| 55 | } else { |
|
| 56 | user_error("undefined property $name"); |
|
| 57 | } |
|
| 58 | } |
|
| 59 | ||
| 60 | public function __get($name) |
|
| 61 | { |
|
| @@ 60-67 (lines=8) @@ | ||
| 57 | } |
|
| 58 | } |
|
| 59 | ||
| 60 | public function __get($name) |
|
| 61 | { |
|
| 62 | $c = $this->camelize($name); |
|
| 63 | $m = "get$c"; |
|
| 64 | if (method_exists($this, $m)) { |
|
| 65 | return $this->$m(); |
|
| 66 | } else { |
|
| 67 | user_error("undefined property $name"); |
|
| 68 | } |
|
| 69 | } |
|
| 70 | ||