当前位置: 首页>>代码示例>>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;未经允许,请勿转载。