[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/validation/src/exception/ -> lmbValidationException.class.php (source)

   1  <?php
   2  /*
   3   * Limb PHP Framework
   4   *
   5   * @link http://limb-project.com 
   6   * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
   7   * @license    LGPL http://www.gnu.org/copyleft/lesser.html 
   8   */
   9  lmb_require('limb/core/src/exception/lmbException.class.php');
  10  
  11  /**
  12   * Validation exception.
  13   * Uses in some classes where validation process is very important for performing an operation successfully
  14   * @see lmbActiveRecord :: save()
  15   * @package validation
  16   * @version $Id: lmbValidationException.class.php 5945 2007-06-06 08:31:43Z pachanga $
  17   */
  18  class lmbValidationException extends lmbException
  19  {
  20    /**

  21    * @var lmbErrorList

  22    */
  23    protected $error_list;
  24  
  25    /**

  26    * Constructor

  27    * @param string Exception message

  28    * @param lmbErrorList List of validation errors

  29    * @param array List of extra exception params

  30    * @param int Exception code

  31    */
  32    function __construct($message, $error_list, $params = array(), $code = 0)
  33    {
  34      $this->error_list = $error_list->getReadable();
  35  
  36      $errors = array();
  37      foreach($this->error_list as $error)
  38        $errors[] .= $error->getMessage();
  39  
  40      $message .= ' Errors list : ' . implode(', ', $errors);
  41  
  42      parent :: __construct($message, $params, $code);
  43    }
  44  
  45    function getErrorList()
  46    {
  47      return $this->error_list;
  48    }
  49  }
  50  
  51  ?>


Generated: Fri Aug 29 04:49:26 2008 Cross-referenced by PHPXref 0.7