當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Kohana_Exception::__construct方法代碼示例

本文整理匯總了PHP中Kohana_Exception::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP Kohana_Exception::__construct方法的具體用法?PHP Kohana_Exception::__construct怎麽用?PHP Kohana_Exception::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Kohana_Exception的用法示例。


在下文中一共展示了Kohana_Exception::__construct方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * 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);
 }
開發者ID:s4urp8n,項目名稱:kohana-admin,代碼行數:18,代碼來源:Exception.php

示例2: __construct

 public function __construct($message = "", array $variables = NULL, $code = NULL, Exception $previous = NULL)
 {
     if (NULL === $code) {
         $code = $this->code;
     }
     parent::__construct($message, $variables, $code, $previous);
 }
開發者ID:vspvt,項目名稱:kohana-restfulapi,代碼行數:7,代碼來源:Conflict.php

示例3: __construct

 /**
  * 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);
 }
開發者ID:piotrtheis,項目名稱:jelly,代碼行數:17,代碼來源:exception.php

示例4: join

 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);
 }
開發者ID:Konro1,項目名稱:pms,代碼行數:7,代碼來源:Validation.php

示例5: __construct

 /**
  * 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);
 }
開發者ID:evopix,項目名稱:minion-database,代碼行數:10,代碼來源:Exception.php

示例6:

 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);
 }
開發者ID:Konro1,項目名稱:pms,代碼行數:8,代碼來源:Methodmissing.php

示例7: __construct

 /**
  * 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;
 }
開發者ID:assad2012,項目名稱:gallery3-appfog,代碼行數:13,代碼來源:Kohana_PHP_Exception.php

示例8: __construct

 /**
  * 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));
 }
開發者ID:assad2012,項目名稱:gallery3-appfog,代碼行數:14,代碼來源:Kohana_404_Exception.php

示例9: __construct

 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);
 }
開發者ID:realmacsoftware,項目名稱:core,代碼行數:8,代碼來源:exception.php

示例10: __construct

 /**
  * 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);
     }
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:17,代碼來源:Exception.php

示例11: __construct

 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;
     }
 }
開發者ID:openbuildings,項目名稱:purchases,代碼行數:10,代碼來源:Payment.php

示例12: __construct

 /**
  * 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);
 }
開發者ID:sysdevbol,項目名稱:entidad,代碼行數:21,代碼來源:exception.php

示例13: __construct

 /**
  * @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)));
     }
 }
開發者ID:vadim-job-hg,項目名稱:Autorize,代碼行數:14,代碼來源:exception.php

示例14: __construct

 /**
  * 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'];
 }
開發者ID:banks,項目名稱:unittest,代碼行數:19,代碼來源:exception.php

示例15: __construct

 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);
 }
開發者ID:vspvt,項目名稱:kohana-restfulapi,代碼行數:16,代碼來源:Exception.php


注:本文中的Kohana_Exception::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。