Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * gives a debug version of blog cleared of all internal Variables
- *
- * @return object the cleared object
- * @author Thomas Allmer <at@delusionworld.com>
- */
- public function __debug() {
- $keepVars = get_class_vars ('F3\Blog\Domain\Model\Blog');
- // unsetting posts here as they currently don't have their own __debug() function
- // if every Class has a __debug() you can view everything; should be best included with the AOP Development Proxy
- unset( $keepVars['posts'] );
- foreach( $this as $var => $value ) {
- if( !array_key_exists($var, $keepVars) )
- unset( $this->$var );
- if ( is_object($value) && method_exists($var, '__debug') )
- $this->$var = $value->__debug();
- }
- return $this;
- }
Add Comment
Please, Sign In to add comment