Esempio n. 1
0
 /**
  * Constructs a new exception for the specified model
  *
  * @param  string     $alias   The alias to use when looking for error messages
  * @param  Validation $object  The Validation object of the model
  * @param  string     $message The error message
  * @param  array      $values  The array of values for the error message
  * @param  integer    $code    The error code for the exception
  *
  * @return void
  */
 public function __construct($alias, Validation $object, $message = 'Failed to validate array', array $values = null, $code = 0, Exception $previous = null)
 {
     $this->_alias = $alias;
     $this->_objects['_object'] = $object;
     $this->_objects['_has_many'] = false;
     parent::__construct($message, $values, $code, $previous);
 }
Esempio n. 2
0
 public function __construct($message = "", array $variables = NULL, $code = NULL, Exception $previous = NULL)
 {
     if (NULL === $code) {
         $code = $this->code;
     }
     parent::__construct($message, $variables, $code, $previous);
 }
Esempio n. 3
0
 /**
  * Constructs a new exception for the specified model
  *
  * @param  string     $alias       The alias to use when looking for error messages
  * @param  Validation $object      The Validation object of the model
  * @param  string     $message     The error message
  * @param  array      $values      The array of values for the error message
  * @param  integer    $code        The error code for the exception
  * @return void
  */
 public function __construct($alias, Validation $object, $message = 'Failed to validate array', array $values = NULL, $code = 0)
 {
     $this->_alias = $alias;
     $this->_objects['_object'] = $object;
     $this->_objects['_has_many'] = FALSE;
     parent::__construct($message, $values, $code);
 }
Esempio n. 4
0
 function __construct($message, $model, $fields = NULL)
 {
     $this->_model = $model;
     $fields[':model'] = $model->meta()->model();
     $fields[':errors'] = join(', ', $model->errors()->messages_all());
     parent::__construct($message, $fields);
 }
Esempio n. 5
0
 /**
  * Constructor
  */
 public function __construct($message, array $migration, array $variables = array(), $code = 0)
 {
     $variables[':migration-id'] = $migration['id'];
     $variables[':migration-group'] = $migration['group'];
     $this->_migration = $migration;
     parent::__construct($message, $variables, $code);
 }
Esempio n. 6
0
 function __construct($sender, $method, array $args = NULL)
 {
     $this->args = $args;
     $this->sender = $sender;
     $fields[':sender'] = get_class($sender);
     $fields[':method'] = $this->method = $method;
     parent::__construct('Object :sender does not have a method :method', $fields);
 }
 /**
  * Create a new PHP error exception.
  *
  * @return  void
  */
 public function __construct($code, $error, $file, $line, $context = NULL)
 {
     parent::__construct($error);
     // Set the error code, file, line, and context manually
     $this->code = $code;
     $this->file = $file;
     $this->line = $line;
 }
 /**
  * Set internal properties.
  *
  * @param  string  URI of page
  * @param  string  custom error template
  */
 public function __construct($page = NULL)
 {
     if ($page === NULL) {
         // Use the complete URI
         $page = Router::$complete_uri;
     }
     parent::__construct('The page you requested, %page%, could not be found.', array('%page%' => $page));
 }
Esempio n. 9
0
 public function __construct($status = 404, $message = NULL, array $values = NULL, $code = 0)
 {
     $this->_status = $status;
     if (!$message) {
         $message = arr::get(Request::$messages, $status);
     }
     parent::__construct($message, $values, $code);
 }
Esempio n. 10
0
 /**
  * Construct the exception
  *
  * @param  string $msg
  * @param  int $code
  * @param  Exception $previous
  * @return void
  */
 public function __construct($msg = '', $code = 0, Exception $previous = null)
 {
     if (version_compare(PHP_VERSION, '5.3.0', '<')) {
         parent::__construct($msg, (int) $code);
         $this->_previous = $previous;
     } else {
         parent::__construct($msg, (int) $code, $previous);
     }
 }
Esempio n. 11
0
 public function __construct($message = "", array $variables = NULL, $code = 0, Exception $previous = NULL, $data = array())
 {
     if ($data and !is_array($data)) {
         $data = json_decode($data, TRUE);
     }
     parent::__construct($message, $variables, $code, $previous, $data);
     if (is_array($data)) {
         $this->data = $data;
     }
 }
Esempio n. 12
0
 /**
  * Creates a new translated exception.
  *
  *     throw new Kohana_Exception('Something went terrible wrong, :user',
  *         array(':user' => $user));
  *
  * @param   string   status message, custom content to display with error
  * @param   array    translation variables
  * @param   integer  the http status code
  * @return  void
  */
 public function __construct($message = NULL, array $variables = NULL, $code = 0)
 {
     if ($code == 0) {
         $code = $this->_code;
     }
     if (!isset(Response::$messages[$code])) {
         throw new Kohana_Exception('Unrecognized HTTP status code: :code . Only valid HTTP status codes are acceptable, see RFC 2616.', array(':code' => $code));
     }
     parent::__construct($message, $variables, $code);
 }
Esempio n. 13
0
 /**
  * @param  object  Authorize.Net response
  */
 public function __construct($response)
 {
     $this->response = $response;
     if ($response instanceof AuthorizeNetResponse) {
         parent::__construct($response->response_reason_text, NULL, $response->response_reason_code);
     } elseif ($response instanceof AuthorizeNetXMLResponse) {
         parent::__construct($response->getMessageText(), NULL, $response->getMessageCode());
     } else {
         throw new Kohana_Exception('Unsupported Authorize.Net response used in :class', array(':class' => get_class($this)));
     }
 }
Esempio n. 14
0
 /**
  * Sets exception message and debug info.
  *
  * @param   string  message
  * @param   mixed   debug info
  * @return  void
  */
 public function __construct($message, array $variables = NULL, $debug = NULL)
 {
     // Failure message
     parent::__construct($message, $variables);
     // Set the debug information
     $this->debug = $debug;
     // Load the stack trace
     $trace = $this->getTrace();
     // Set the error location to the assertation call
     $this->file = $trace[0]['file'];
     $this->line = $trace[0]['line'];
 }
Esempio n. 15
0
 public function __construct($code = NULL, $message = NULL, array $variables = NULL, $errno = NULL, array $debug = NULL, Exception $previous = NULL)
 {
     $this->_errno = (int) $errno;
     $this->_debug = $debug;
     $code = NULL === $code ? $this->code : $code;
     if (NULL === $message) {
         if (isset(Response::$messages[$code])) {
             $message = Response::$messages[$code];
         } else {
             $message = 'RestfulAPI_Exception [ :code ] - unknown';
             $variables = [':code' => $code];
             $code = 500;
         }
     }
     parent::__construct($message, $variables, $code, $previous);
 }
Esempio n. 16
0
 /**
  * Creates a new translated exception.
  *
  *     throw new Kohana_Exception('Something went terrible wrong, :user',
  *         array(':user' => $user));
  *
  * @param   string  $message    status message, custom content to display with error
  * @param   array   $variables  translation variables
  * @return  void
  */
 public function __construct($message = NULL, array $variables = NULL, Exception $previous = NULL)
 {
     parent::__construct($message, $variables, $this->_code, $previous);
 }
Esempio n. 17
0
 /**
  * @param  Validation   $array      Validation object
  * @param  string       $message    error message
  * @param  array        $values     translation variables
  * @param  int          $code       the exception code
  */
 public function __construct(Validation $array, $message = 'Failed to validate array', array $values = NULL, $code = 0)
 {
     $this->array = $array;
     parent::__construct($message, $values, $code);
 }
 public function __construct(Document $document, $metadata_name)
 {
     $document_desc = $document->reference . '[' . $document->id . ']';
     parent::__construct(Documents_No_Such_Metadata_Exception::exception_key, $document_desc, $metadata_name);
 }
Esempio n. 19
0
File: Event.php Progetto: Konro1/pms
 function __construct($message, $event, $fields = NULL)
 {
     $fields[':event'] = $this->event = $event;
     parent::__construct($message, $fields);
 }
Esempio n. 20
0
 /**
  * @param  Warning   $array      Validation object
  * @param  string       $message    error message
  * @param  array        $values     translation variables
  * @param  int          $code       the exception code
  */
 public function __construct($message = '', array $values = NULL, $code = 0, Exception $previous = NULL)
 {
     parent::__construct($message, $values, $code, $previous);
 }
Esempio n. 21
0
 public function __construct($message, $timestamp)
 {
     $this->timestamp = $timestamp;
     parent::__construct($message);
 }
Esempio n. 22
0
 public function __construct($title, array $message = NULL, $errors = '')
 {
     parent::__construct($title, $message);
     $this->errors = $errors;
 }
 /**
  * Set exception title and message.
  *
  * @param   string  exception title string
  * @param   string  exception message string
  * @param   string  custom error template
  */
 public function __construct($title, $message, array $variables = NULL)
 {
     parent::__construct($message, $variables);
     // Code is the error title
     $this->code = $title;
 }
Esempio n. 24
0
 /**
  * Model not found or no access
  *
  * @param  Jelly_Model $model
  * @param  integer     $id
  */
 public function __construct(Jelly_Model $model, $id = 0)
 {
     parent::__construct('Model not found: :model #:id', array(':id' => $id, ':model' => Jelly::model_name($model)));
 }
Esempio n. 25
0
 /**
  * Constructs a new exception for the specified model
  *
  * @param  Validation $object      The Validation object of the model
  * @param  string     $message     The error message
  * @param  array      $values      The array of values for the error message
  * @param  integer    $code        The error code for the exception
  * @return void
  */
 public function __construct($errors, $message = 'Failed to validate array', array $values = NULL)
 {
     $this->_errors = $errors;
     parent::__construct($message, $values, API::ERROR_VALIDATION);
 }
 public function __construct(ORM $object, $number_in_db, $number_to_remove, $min_limit)
 {
     $object_desc = $object->object_name . '[' . $object->id . ']';
     parent::__construct(Workshop_Min_Limit_Exception::exception_key, $object_desc, $number_in_db, $number_to_remove, $min_limit);
 }
Esempio n. 27
0
 /**
  * Creates a new translated exception.
  *
  * @param   string   error message
  * @param   array    translation variables
  * @return  void
  */
 public function __construct($message, array $variables = NULL, $code = 404)
 {
     // Pass the message to the parent
     parent::__construct($message, $variables, $code);
 }
Esempio n. 28
0
 function __construct($message, $model, $fields = NULL)
 {
     $fields[':model'] = $this->model = $model;
     parent::__construct($message, $fields);
 }
Esempio n. 29
0
 function __construct($message, $fields = NULL)
 {
     parent::__construct($message, $fields);
 }
Esempio n. 30
0
 /**
  * Creates a new translated database exception.
  *
  *     throw new Database_Exception(1234, 'Something went terrible wrong, :user',
  *         array(':user' => $user));
  *
  * @param   string   raw DB error code
  * @param   string   error message
  * @param   array    translation variables
  * @param   integer  the exception code
  * @return  void
  */
 public function __construct($db_code, $message, array $variables = NULL, $code = 0)
 {
     $this->db_code = $db_code;
     parent::__construct($message, $variables, $code);
 }