Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function toArray()
- {
- $reflectionClass = new \ReflectionClass(get_class($this));
- $array = [];
- foreach ($reflectionClass->getProperties() as $property) {
- $property->setAccessible(true);
- $array[$property->getName()] = $property->getValue($this);
- $property->setAccessible(false);
- }
- return $array;
- }
Add Comment
Please, Sign In to add comment