Guest User

Untitled

a guest
Jun 18th, 2018
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. /**
  2. * gives a debug version of blog cleared of all internal Variables
  3. *
  4. * @return object the cleared object
  5. * @author Thomas Allmer <at@delusionworld.com>
  6. */
  7. public function __debug() {
  8. $keepVars = get_class_vars ('F3\Blog\Domain\Model\Blog');
  9. // unsetting posts here as they currently don't have their own __debug() function
  10. // if every Class has a __debug() you can view everything; should be best included with the AOP Development Proxy
  11. unset( $keepVars['posts'] );
  12.  
  13. foreach( $this as $var => $value ) {
  14. if( !array_key_exists($var, $keepVars) )
  15. unset( $this->$var );
  16. if ( is_object($value) && method_exists($var, '__debug') )
  17. $this->$var = $value->__debug();
  18. }
  19.  
  20. return $this;
  21. }
Add Comment
Please, Sign In to add comment