Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # PHP, populate object through reflection
- # $class->reflFields is an array of ReflectionProperty's
- foreach ($data as $field => $value) {
- if (isset($class->reflFields[$field])) {
- $class->reflFields[$field]->setValue($entity, $value);
- }
- }
- # C
- doctrine_populate_object($entity, $data) // maybe?
Add Comment
Please, Sign In to add comment