Guest User

Untitled

a guest
Jul 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.07 KB | None | 0 0
  1. <?php defined('SYSPATH') or die('No direct script access.');
  2. /**
  3.  * ORM Validation exceptions with locale based error messages
  4.  *
  5.  * @package    URP
  6.  * @author     Rex
  7.  * @copyright  (c) 2011 Eksu
  8.  */
  9. class ORM_Validation_Exception extends Kohana_ORM_Validation_Exception
  10. {
  11.     /**
  12.      * Constructs a new exception for the specified model. Use locale based aliases
  13.      *
  14.      * @param  string     $alias       The alias to use when looking for error messages
  15.      * @param  Validation $object      The Validation object of the model
  16.      * @param  string     $message     The error message
  17.      * @param  array      $values      The array of values for the error message
  18.      * @param  integer    $code        The error code for the exception
  19.      * @return void
  20.      */
  21.     public function __construct($alias, Validation $object, $message = 'Failed to validate array', array $values = NULL, $code = 0)
  22.     {
  23.         parent::__construct($alias, $object, $message, $values, $code);
  24.         //Имя с учетом локали ;-)
  25.         $this->_alias = $alias . '-' . $this->lang;
  26.     }
  27. } // End ORM_Validation_Exception
Add Comment
Please, Sign In to add comment