Posted By

ryantxr on 10/10/12


Tagged

class object base


Versions (?)

BaseObject


 / Published in: PHP
 

I use this as a parent for all classes to add logger methods and some other functions as needed.

  1. class BaseObject{
  2. public $debug = false;
  3. function log($msg){
  4. /* Put call to logging here. Write to regular log. */
  5. }
  6.  
  7. public function debug($msg){
  8. if ( ! $this->debug ) return;
  9. /* Put call to logging here. Write to debug log. */
  10. }
  11. }

Report this snippet  

You need to login to post a comment.