| @@ 129-144 (lines=16) @@ | ||
| 126 | * |
|
| 127 | * @return bool |
|
| 128 | */ |
|
| 129 | public function __isset($name) |
|
| 130 | { |
|
| 131 | $issetter = sprintf('isset%s', ucfirst(Inflector::camelize($name))); |
|
| 132 | if (method_exists($this, $issetter)) |
|
| 133 | { |
|
| 134 | return $this->$issetter(); |
|
| 135 | } |
|
| 136 | ||
| 137 | $key = Inflector::tableize($name); |
|
| 138 | if (array_key_exists($key, $this->data)) |
|
| 139 | { |
|
| 140 | return true; |
|
| 141 | } |
|
| 142 | ||
| 143 | return isset($this->$name); |
|
| 144 | } |
|
| 145 | ||
| 146 | /** |
|
| 147 | * @param string $name |
|
| @@ 151-166 (lines=16) @@ | ||
| 148 | * |
|
| 149 | * @return mixed |
|
| 150 | */ |
|
| 151 | public function __get($name) |
|
| 152 | { |
|
| 153 | $getter = sprintf('get%s', ucfirst(Inflector::camelize($name))); |
|
| 154 | if (method_exists($this, $getter)) |
|
| 155 | { |
|
| 156 | return $this->$getter(); |
|
| 157 | } |
|
| 158 | ||
| 159 | $key = Inflector::tableize($name); |
|
| 160 | if (array_key_exists($key, $this->data)) |
|
| 161 | { |
|
| 162 | return $this->data[$key]; |
|
| 163 | } |
|
| 164 | ||
| 165 | return $this->$name; |
|
| 166 | } |
|
| 167 | ||
| 168 | /** |
|
| 169 | * @param string $name |
|