Guest User

Untitled

a guest
Jun 18th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1.  
  2. # PHP, populate object through reflection
  3. # $class->reflFields is an array of ReflectionProperty's
  4.  
  5. foreach ($data as $field => $value) {
  6. if (isset($class->reflFields[$field])) {
  7. $class->reflFields[$field]->setValue($entity, $value);
  8. }
  9. }
  10.  
  11.  
  12. # C
  13.  
  14. doctrine_populate_object($entity, $data) // maybe?
Add Comment
Please, Sign In to add comment