コード例 #1
0
 /**
  * Constructs an ezcQueryVariableParameterException with the method $method
  * and the arguments $numProvided and $numExpected.
  *
  * @param string $method
  * @param int $numProvided
  * @param int $numExpected
  */
 public function __construct($method, $numProvided, $numExpected)
 {
     $expectedString = "{$numExpected} parameter";
     if ($numExpected > 1) {
         $expectedString .= 's';
     }
     $providedString = "none were provided";
     if ($numProvided == 1) {
         $providedString = "only one was provided";
     } else {
         if ($numProvided > 1) {
             $providedString = "only {$numProvided} were provided";
         }
     }
     $info = "The method '{$method}' expected at least {$expectedString} but {$providedString}.";
     parent::__construct($info);
 }
コード例 #2
0
ファイル: invalid.php プロジェクト: Adeelgill/livehelperchat
 /**
  * Constructs a QueryInvalid exception with the type $type and the
  * additional information $message.
  *
  * $type should be used to specify the type of the query that failed.
  * Possible values are SELECT, INSERT, UPDATE and DELETE.
  *
  * Use $message to specify exactly what went wrong.
  *
  * @param string $type
  * @param string $message
  */
 public function __construct($type, $message)
 {
     $info = "The '{$type}' query could not be built. {$message}";
     parent::__construct($message);
 }
コード例 #3
0
 /**
  * Constructs an ezcQueryVariableParameterException.
  *
  * @param string $method
  * @param int $parameterNumber
  * @param string $foundContents
  * @param string $expectedContents
  */
 public function __construct($method, $parameterNumber, $foundContents, $expectedContents)
 {
     $info = "Argument '{$parameterNumber}' of method '{$method}' expects {$expectedContents} but {$foundContents} was provided.";
     parent::__construct($info);
 }