예제 #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
 /**
  * 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);
 }
 /**
  * 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);
 }