| @@ 22-31 (lines=10) @@ | ||
| 19 | * |
|
| 20 | * @api |
|
| 21 | */ |
|
| 22 | public function getValue($object, $propertyName) |
|
| 23 | { |
|
| 24 | $this->validateObject($object); |
|
| 25 | $reflection = new \ReflectionClass($object); |
|
| 26 | $this->validateProperty($reflection, $object, $propertyName); |
|
| 27 | $property = $reflection->getProperty($propertyName); |
|
| 28 | $property->setAccessible(true); |
|
| 29 | ||
| 30 | return $property->getValue($object); |
|
| 31 | } |
|
| 32 | ||
| 33 | /** |
|
| 34 | * @param $object |
|
| @@ 42-51 (lines=10) @@ | ||
| 39 | * |
|
| 40 | * @api |
|
| 41 | */ |
|
| 42 | public function setValue($object, $propertyName, $value) |
|
| 43 | { |
|
| 44 | $this->validateObject($object); |
|
| 45 | $reflection = new \ReflectionClass($object); |
|
| 46 | $this->validateProperty($reflection, $object, $propertyName); |
|
| 47 | $property = $reflection->getProperty($propertyName); |
|
| 48 | $property->setAccessible(true); |
|
| 49 | ||
| 50 | $property->setValue($object, $value); |
|
| 51 | } |
|
| 52 | ||
| 53 | /** |
|
| 54 | * @param $value |
|