|
@@ 21-27 (lines=7) @@
|
| 18 |
|
{ |
| 19 |
|
$reflectionClass = new ReflectionClass($object); |
| 20 |
|
|
| 21 |
|
foreach ($reflectionClass->getMethods(ReflectionMethod::IS_PUBLIC) as $reflectionMethod) { |
| 22 |
|
if (!$reflectionMethod->isStatic() |
| 23 |
|
&& $reflectionMethod->getNumberOfRequiredParameters() == 0 |
| 24 |
|
&& strcasecmp($reflectionMethod->getName(), "get$field") == 0) { |
| 25 |
|
return $reflectionMethod->invoke($object); |
| 26 |
|
} |
| 27 |
|
} |
| 28 |
|
if ($reflectionClass->hasProperty($field)) { |
| 29 |
|
$property = $reflectionClass->getProperty($field); |
| 30 |
|
if (!$property->isStatic()) { |
|
@@ 55-62 (lines=8) @@
|
| 52 |
|
{ |
| 53 |
|
$reflectionClass = new ReflectionClass($object); |
| 54 |
|
|
| 55 |
|
foreach ($reflectionClass->getMethods(ReflectionMethod::IS_PUBLIC) as $reflectionMethod) { |
| 56 |
|
if (!$reflectionMethod->isStatic() |
| 57 |
|
&& $reflectionMethod->getNumberOfRequiredParameters() == 1 |
| 58 |
|
&& strcasecmp($reflectionMethod->getName(), "set$field") == 0) { |
| 59 |
|
$reflectionMethod->invoke($object, $value); |
| 60 |
|
return; |
| 61 |
|
} |
| 62 |
|
} |
| 63 |
|
if ($reflectionClass->hasProperty($field)) { |
| 64 |
|
$property = $reflectionClass->getProperty($field); |
| 65 |
|
if (!$property->isStatic()) { |