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


PHP CakeException::__construct方法代碼示例

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


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

示例1: __construct

 public function __construct($message = null, $code = 422)
 {
     if (empty($message)) {
         $message = __('Validation Error.');
     }
     parent::__construct($message, $code);
 }
開發者ID:k1low,項目名稱:routine,代碼行數:7,代碼來源:ValidationException.php

示例2: __construct

 public function __construct($message = null, $code = 302)
 {
     if (empty($message)) {
         $message = __('Exception Error.');
     }
     parent::__construct($message, $code);
 }
開發者ID:k1low,項目名稱:ya,代碼行數:7,代碼來源:InactiveControllerException.php

示例3: __construct

 public function __construct($message = null, $code = 500)
 {
     if (empty($message)) {
         $message = __('Yasd Error.');
     }
     parent::__construct($message, $code);
 }
開發者ID:k1low,項目名稱:yasd,代碼行數:7,代碼來源:YasdException.php

示例4: __construct

 /**
  * Constructor
  *
  * @param string $message If no message is given 'Not Found Data' will be the message
  * @param string $code Status code, defaults to 404
  */
 public function __construct($message = null, $code = 404)
 {
     if (empty($message)) {
         $message = __d('Yacsv', 'YacsvException');
     }
     parent::__construct($message, $code);
 }
開發者ID:k1low,項目名稱:yacsv,代碼行數:13,代碼來源:YacsvException.php

示例5: __construct

 public function __construct($message = null, $code = 404)
 {
     if (Configure::read('debug')) {
         $code = 500;
     }
     parent::__construct($message, $code);
 }
開發者ID:gourmet,項目名稱:common,代碼行數:7,代碼來源:CommonBadConfigurationException.php

示例6: __construct

 /**
  * @param null $message
  * @param int $code
  */
 public function __construct($message = NULL, $code = 500)
 {
     if (!is_string($message)) {
         $renderer = 'The specified asset renderer';
         if (!empty($message['renderer'])) {
             $renderer = 'Asset renderer ' . $message['renderer'];
         }
         $message = "{$renderer} was not found in this helper.";
     }
     parent::__construct($message, $code);
 }
開發者ID:netors,項目名稱:CakePHP-AutoAsset-Plugin,代碼行數:15,代碼來源:AssetRendererNotFoundException.php

示例7: __construct

 /**
  * @param null $message
  * @param int $code
  */
 public function __construct($message = NULL, $code = 500)
 {
     if (!is_string($message)) {
         $block = 'The specified asset block';
         if (!empty($message['assetBLock'])) {
             $block = 'Asset block ' . $message['assetBLock'];
         }
         $message = "{$block} does not exist.";
     }
     parent::__construct($message, $code);
 }
開發者ID:netors,項目名稱:CakePHP-AutoAsset-Plugin,代碼行數:15,代碼來源:AssetBlockNotFoundException.php

示例8: __construct

 /**
  * Constructor
  *
  * @param array $error list of validation errors
  * @param integer $code code to report to client
  * @return void
  */
 public function __construct($errors, $code = 412)
 {
     $this->_validationErrors = array_filter($errors);
     $flat = Hash::flatten($this->_validationErrors);
     $errorCount = $this->_validationErrorCount = count($flat);
     $this->message = __dn('crud', 'A validation error occurred', '%d validation errors occurred', $errorCount, array($errorCount));
     if ($errorCount === 1) {
         $code = $this->_deriveRuleSpecific($this->_validationErrors, $code);
     }
     parent::__construct($this->message, $code);
 }
開發者ID:linking-arts,項目名稱:furry-goggles,代碼行數:18,代碼來源:CrudValidationException.php

示例9: __construct

 /**
  * Sobrescreve exceção do Cake para incluir informação
  * do erro que poderá ser logada.
  *
  * @param string  $message Mensagem da Exceção
  * @param integer $code    Código do erro
  * @param string  $error   O erro retornado pelo PagSeguro (possivelmente um XML)
  */
 public function __construct($message, $code = 1, $error = null)
 {
     if (!empty($error)) {
         try {
             $decoded = Xml::toArray(Xml::build($error));
             $error = $this->_parseXmlError($decoded);
         } catch (XmlException $e) {
             // apenas uma string... não faz conversão
         }
         $error .= $this->getTraceAsString();
         $msg = $message . " (Problema relacionado ao PagSeguro)\n" . $error;
         CakeLog::write('error', $msg);
     }
     parent::__construct($message, $code);
 }
開發者ID:radig,項目名稱:pagseguro,代碼行數:23,代碼來源:PagSeguroException.php

示例10: __construct

 /**
  * @param null $message
  * @param int $code
  */
 public function __construct($message = NULL, $code = 500)
 {
     if (!is_string($message)) {
         $method = 'The specified method';
         if (!empty($message['helperMethod'])) {
             $method = 'Method ' . $message['helperMethod'];
         }
         $helper = 'helper';
         if (!empty($message['helper'])) {
             $helper .= ' ' . $message['helper'];
         }
         $message = "{$method} of {$helper} does not exist.";
     }
     parent::__construct($message, $code);
 }
開發者ID:netors,項目名稱:CakePHP-AutoAsset-Plugin,代碼行數:19,代碼來源:HelperMethodNotFoundException.php

示例11: __construct

 /**
  * @param null $message
  * @param int $code
  */
 public function __construct($message = NULL, $code = 500)
 {
     if (!is_string($message)) {
         $class = 'The specified asset class';
         if (!empty($message['class'])) {
             $class = 'Asset class ' . $message['class'];
         }
         $package = 'Lib/Asset';
         if (!empty($message['plugin'])) {
             $package = $message['plugin'] . ".{$package}";
         }
         $message = "{$class} could not be located in package {$package}";
     }
     parent::__construct($message, $code);
 }
開發者ID:netors,項目名稱:CakePHP-AutoAsset-Plugin,代碼行數:19,代碼來源:MissingAssetClassException.php

示例12: __construct

 /**
  * @param null $message
  * @param int $code
  */
 public function __construct($message = NULL, $code = 500)
 {
     if (!is_string($message)) {
         $type = 'The asset type being used';
         if (!empty($message['type'])) {
             $type = 'Asset type ' . $message['type'];
         }
         $class = 'this class';
         if (!empty($message['class'])) {
             $class = 'class ' . $message['class'];
         }
         $message = "{$type} is not supported by {$class}.";
     }
     parent::__construct($message, $code);
 }
開發者ID:netors,項目名稱:CakePHP-AutoAsset-Plugin,代碼行數:19,代碼來源:AssetTypeUnsupportedException.php

示例13: __construct

 public function __construct($message, $code = 404, Exception $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }
開發者ID:ronaldsalazar23,項目名稱:ComercialChiriguano,代碼行數:4,代碼來源:exceptions.php

示例14: __construct

 public function __construct($message = 'Unauthorized', $code = 101)
 {
     parent::__construct($message, $code);
 }
開發者ID:nilBora,項目名稱:konstruktor,代碼行數:4,代碼來源:ApiUnauthorizedException.php

示例15: __construct

 public function __construct($message, $data = null, $debugOnly = null)
 {
     $code = 417;
     parent::__construct($message . ': ' . $data, $code);
 }
開發者ID:jammy-git,項目名稱:CakePHP-Eip,代碼行數:5,代碼來源:EipComponentTest.php


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