| @@ 311-320 (lines=10) @@ | ||
| 308 | */ |
|
| 309 | private function castObject(\stdClass $sourceObject, $destinationClass, array $ctorArgs = []) |
|
| 310 | { |
|
| 311 | if ( ! is_string($destinationClass)) { |
|
| 312 | if ( ! is_object($destinationClass)) { |
|
| 313 | throw new DB2Exception(sprintf( |
|
| 314 | 'Destination class has to be of type string or object, %s given.', gettype($destinationClass) |
|
| 315 | )); |
|
| 316 | } |
|
| 317 | } else { |
|
| 318 | $destinationClass = new \ReflectionClass($destinationClass); |
|
| 319 | $destinationClass = $destinationClass->newInstanceArgs($ctorArgs); |
|
| 320 | } |
|
| 321 | ||
| 322 | $sourceReflection = new \ReflectionObject($sourceObject); |
|
| 323 | $destinationClassReflection = new \ReflectionObject($destinationClass); |
|
| @@ 316-325 (lines=10) @@ | ||
| 313 | */ |
|
| 314 | private function castObject(\stdClass $sourceObject, $destinationClass, array $ctorArgs = []) |
|
| 315 | { |
|
| 316 | if ( ! is_string($destinationClass)) { |
|
| 317 | if ( ! is_object($destinationClass)) { |
|
| 318 | throw new SQLAnywhereException(sprintf( |
|
| 319 | 'Destination class has to be of type string or object, %s given.', gettype($destinationClass) |
|
| 320 | )); |
|
| 321 | } |
|
| 322 | } else { |
|
| 323 | $destinationClass = new \ReflectionClass($destinationClass); |
|
| 324 | $destinationClass = $destinationClass->newInstanceArgs($ctorArgs); |
|
| 325 | } |
|
| 326 | ||
| 327 | $sourceReflection = new \ReflectionObject($sourceObject); |
|
| 328 | $destinationClassReflection = new \ReflectionObject($destinationClass); |
|