Source for file Report.class.php

Documentation is available at Report.class.php

  1. <?php
  2. /**
  3.  * Gumbo Library Framework
  4.  *
  5.  * LICENSE
  6.  * This library is being released under the terms of the New BSD License.  A
  7.  * copy of the license is packaged with the software (LICENSE.txt).  If no
  8.  * copy is found, a copy of the license template can be found at:
  9.  * http://www.opensource.org/licenses/bsd-license.php
  10.  * 
  11.  * @category Gumbo
  12.  * @package Debug
  13.  * @copyright Copyright (c) 2007, iBayou, Michael Luster
  14.  * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
  15.  * @author Michael Luster <mluster79@yahoo.com>
  16.  * @link http://sourceforge.net/projects/phpgumbo
  17.  * @version 0.0.1
  18.  */
  19.  
  20. /**
  21.  * Abstract Debug Report Class
  22.  *
  23.  * @category Gumbo
  24.  * @package Debug
  25.  * @copyright Copyright (c) 2007, iBayou, Michael Luster
  26.  * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
  27.  * @author Michael Luster <mluster79@yahoo.com>
  28.  * @link http://sourceforge.net/projects/phpgumbo
  29.  * @desc Abstract Debug Report Class
  30.  * @version 0.0.1
  31.  */
  32.  
  33. gumbo_load ("Interface_Debug_Message");
  34. gumbo_load ("Interface_Debug_Report");
  35.  
  36. abstract class Gumbo_Debug_Report implements Gumbo_Interface_Debug_Report {
  37.     
  38.     /** @var array $_messages Debug_Message list */
  39.     private $_messages = array ();
  40.     
  41.     
  42.     
  43.     /** MUTATOR METHODS **/
  44.     /**
  45.      * Sets the Debug messages
  46.      * @param Debug_Message[] $mess 
  47.      * @throws Gumbo_Exception
  48.      */
  49.     public function setMessages ($mess{
  50.         try {
  51.             // verify precondition
  52.             if (!is_array ($mess)) {
  53.                 throw new Gumbo_Exception ("Invalid Argument 'mess:arr' => {$mess}:gettype ($mess));
  54.             }
  55.             
  56.             $this->_messages = array ();
  57.             foreach ($mess as $obj{
  58.                 if (!($obj instanceof Gumbo_Interface_Debug_Message)) {
  59.                     continue;
  60.                 }
  61.                 $this->_messages [$obj;
  62.             }
  63.         catch (Gumbo_Exception $e{
  64.             $e->setFunction (__METHOD__);
  65.             gumbo_trigger ($e);
  66.         }
  67.     }
  68.     
  69.     
  70.     
  71.     /** ACCESSOR METHODS **/
  72.     /**
  73.      * Returns the Debug messages
  74.      * @return Gumbo_Interface_Debug_Message[] 
  75.      */
  76.     public function getMessages ({
  77.         return $this->_messages;
  78.     }
  79.     
  80. }
  81.  
  82. ?>