| @@ 130-138 (lines=9) @@ | ||
| 127 | * @param mixed $name |
|
| 128 | * @return mixed |
|
| 129 | */ |
|
| 130 | public function __get($name) |
|
| 131 | { |
|
| 132 | $getProperty = 'get' . $name; |
|
| 133 | if (in_array($getProperty, $this->properties)) { |
|
| 134 | return $this->$getProperty(); |
|
| 135 | } else { |
|
| 136 | throw new Exception('Property ' . $name . ' does not exists.'); |
|
| 137 | } |
|
| 138 | } |
|
| 139 | ||
| 140 | /** |
|
| 141 | * Allow functions that begins with 'set' to be called directly |
|
| @@ 146-154 (lines=9) @@ | ||
| 143 | * @param mixed $name |
|
| 144 | * @param mixed $value |
|
| 145 | */ |
|
| 146 | public function __set($name, $value) |
|
| 147 | { |
|
| 148 | $setProperty = 'set' . $name; |
|
| 149 | if (in_array($setProperty, $this->properties)) { |
|
| 150 | $this->$setProperty($value); |
|
| 151 | } else { |
|
| 152 | throw new Exception('Property ' . $name . ' can not be set.'); |
|
| 153 | } |
|
| 154 | } |
|
| 155 | ||
| 156 | ||
| 157 | /** |
|