Advertisement
Guest User

Untitled

a guest
Apr 28th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. class Model {
  2.  
  3. public function foo() {
  4.  
  5. $metaData = new ReflectionClass($this);
  6. $properties = $metaData->getProperties(ReflectionProperty::IS_PRIVATE);
  7. foreach ($properties as $property)
  8. {
  9. $property->setAccessible(true);
  10. print $property->getName() . " = ";
  11. print $property->getValue($metaData);
  12. print '<br/>';
  13. }
  14.  
  15. }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement