PHP Classes

File: classes/debug/debug-capable.php

Recommend this page to a friend!
  Classes of Gonzalo Chumillas   DbTable   classes/debug/debug-capable.php   Download  
File: classes/debug/debug-capable.php
Role: Class source
Content type: text/plain
Description: Class source
Class: DbTable
Update table records in multiple related tables
Author: By
Last change:
Date: 9 years ago
Size: 1,304 bytes
 

Contents

Class file image Download
<?php
/**
 * This file is part of Soloproyectos common library.
 *
 * @author Gonzalo Chumillas <gchumillas@email.com>
 * @license https://github.com/soloproyectos/php.common-libs/blob/master/LICENSE BSD 2-Clause License
 * @link https://github.com/soloproyectos/php.common-libs
 */
namespace com\soloproyectos\common\debug;
use \
Exception;

trait
DebugCapable
{
   
/**
     * Is the class in 'debug-mode'?
     * @var boolean
     */
   
private $_isDebugMode = false;
   
   
/**
     * Debug handler.
     *
     * @param mixed $object Object to debug
     *
     * @return void
     */
   
abstract protected function debugger($object);
   
   
/**
     * Debugs an object.
     *
     * @param mixed $object Object to debug
     *
     * @return void
     */
   
protected function debug($object)
    {
        if (
$this->_isDebugMode) {
           
$this->debugger($object);
        }
    }
   
   
/**
     * Is the class in 'debug-mode'?
     *
     * @return boolean
     */
   
public function isDebugMode()
    {
        return
$this->_isDebugMode;
    }
   
   
/**
     * Sets the 'debug-mode' property.
     *
     * @param boolean $value Value
     *
     * @return void
     */
   
public function setDebugMode($value)
    {
       
$this->_isDebugMode = $value;
    }
}