Source for file Abstract_Exception.php

Documentation is available at Abstract_Exception.php

  1. <?php
  2. /**
  3.  *    LAIKA FRAMEWORK Release Notes:
  4.  *
  5.  *    @filesource     Abstract_Exception.php
  6.  *
  7.  *    @version        0.1.0b
  8.  *    @package        Laika
  9.  *    @subpackage     core
  10.  *    @category       abstract
  11.  *    @date           2011-05-22 08:50:52 -0400 (Sun, 22 May 2011)
  12.  *
  13.  *    @author         Leonard M. Witzel <witzel@post.harvard.edu>
  14.  *    @copyright      Copyright (c) 2011  Laika Soft <{@link http://oafbot.com}>
  15.  *
  16.  */ 
  17. /**
  18.  * Abstract Laika_Abstract_Exception class.
  19.  * 
  20.  * @abstract
  21.  * @extends    Exception
  22.  * @implements Laika_Interface_Exception
  23.  */
  24. abstract class Laika_Abstract_Exception extends Exception implements Laika_Interface_Exception{
  25.  
  26. //-------------------------------------------------------------------
  27. //    VARIABLES
  28. //-------------------------------------------------------------------
  29.     protected $message = 'Unknown exception';     // Exception message
  30.     private   $string;                            // Unknown
  31.     protected $code    = 0;                       // User-defined exception code
  32.     protected $file;                              // Source filename of exception
  33.     protected $line;                              // Source line of exception
  34.     private   $trace;                             // Unknown
  35.  
  36. //-------------------------------------------------------------------
  37. //    CONSTRUCTOR
  38. //-------------------------------------------------------------------
  39.  
  40.     /**
  41.      * __construct function.
  42.      * 
  43.      * @access public
  44.      * @param mixed $message (default: null)
  45.      * @param int $code (default: 0)
  46.      * @return void 
  47.      */
  48.     public function __construct($message null$code 0){
  49.         if(!$messagethrow new $this('Unknown 'get_class($this));
  50.         parent::__construct($message$code);
  51.     }
  52.    
  53.     /**
  54.      * __toString function.
  55.      * 
  56.      * @access public
  57.      * @return void 
  58.      */
  59.     public function __toString(){
  60.         return get_class($this" '{$this->message}' in {$this->file}({$this->line})\n"
  61.                                 . "{$this->getTraceAsString()}";
  62.     }
  63.  

Documentation generated on Sat, 19 May 2012 02:16:52 -0400 by phpDocumentor 1.4.4