Exemplo n.º 1
0
 /**
  * @param string $entity   The type of the entity, which was not found
  * @param string $argument The argument of the entity, which was not passed
  */
 public function __construct($entity, $argument)
 {
     $this->entity = $entity;
     $this->argument = $argument;
     $message = 'The "' . $entity . '"-entity requires a "' . $argument . '"-argument';
     parent::__construct($message, 0);
 }
 /**
  * @param string $field
  */
 public function __construct($field, $entity, $type, $code)
 {
     $this->field = $field;
     $this->entity = $entity;
     $this->type = $type;
     parent::__construct(sprintf('%s constraint for field "%s" of entity "%s" violated', ucfirst($type), $field, $entity), $code);
 }
Exemplo n.º 3
0
 /**
  * @param string $entity The type of the entity, which was not found
  * @param int    $id     The id of the entity, which was not found
  */
 public function __construct($entity, $id)
 {
     $this->entity = $entity;
     $this->id = $id;
     $message = 'Entity with the type "' . $entity . '" and the id "' . $id . '" not found.';
     parent::__construct($message, 0);
 }
 /**
  * @param string $entity The type of the entity, which was not found
  * @param int    $id     The id of the entity, which was not found
  */
 public function __construct($entity, $id)
 {
     $this->entity = $entity;
     $this->id = $id;
     $message = 'The id-field of the  "' . $entity . '"-Entity already has an id with the value "' . $id . '" .';
     parent::__construct($message, 0);
 }
Exemplo n.º 5
0
 /**
  * @param string $entity        The type of the entity
  * @param string $argument      The argument of the entity, which was invalid
  * @param null   $customMessage
  */
 public function __construct($entity, $argument, $customMessage = null)
 {
     $this->entity = $entity;
     $this->argument = $argument;
     $message = 'The "' . $entity . '"-entity requires a valid "' . $argument . '"-argument. ';
     if ($customMessage != null) {
         $message .= $customMessage;
     }
     parent::__construct($message, 0);
 }
Exemplo n.º 6
0
 /**
  * Constructor
  * 
  * @param string $updated_since
  */
 public function __construct($updated_since)
 {
     parent::__construct('rest_updatedsince_bad_format', 400, array('updatedSince' => $updated_since));
 }
Exemplo n.º 7
0
 /**
  * @param string $controller
  * @param string[] $names
  */
 public function __construct($controller, $names)
 {
     parent::__construct(sprintf('Missing parameter "%s" in %s', implode('" or "', $names), $controller), 0);
     $this->controller = $controller;
     $this->names = $names;
 }
 /**
  * Constructor
  * 
  * @param int $id
  */
 public function __construct($id)
 {
     parent::__construct('survey_not_found', 404, array('id' => $id));
 }
 /**
  * Constructor
  * 
  * @param Survey $survey
  */
 public function __construct($survey)
 {
     parent::__construct('vote_already_exists', 403, array('survey_id' => $survey->id));
 }
Exemplo n.º 10
0
 /**
  * @param array $errors
  * @param int $code
  */
 public function __construct(array $errors, $code = 422)
 {
     $this->errors = $errors;
     parent::__construct(json_encode($errors), $code, null);
 }
Exemplo n.º 11
0
 /**
  * Constructor
  *
  * @param string     $message Error message
  * @param \Exception $prev    Previous Exception
  */
 public function __construct($message = "Serialization Error", $prev = null)
 {
     parent::__construct(Response::HTTP_INTERNAL_SERVER_ERROR, $message, $prev);
 }
 /**
  * Constructor
  *
  * @param string     $message Error message
  * @param \Exception $prev    Previous Exception
  */
 public function __construct($message = "Record must not be modified", $prev = null)
 {
     parent::__construct(Response::HTTP_BAD_REQUEST, $message, $prev);
 }
Exemplo n.º 13
0
 public function __construct($controller, $name)
 {
     parent::__construct(sprintf('Missing parameter %s in %s', $name, $controller), 0);
     $this->controller = $controller;
     $this->name = $name;
 }
Exemplo n.º 14
0
 /**
  * Constructor
  * 
  * @param string $name name of the bad parameter
  */
 public function __construct($name)
 {
     parent::__construct('rest_bad_parameter', 400, $name);
 }
Exemplo n.º 15
0
 public function __construct($entity, $id)
 {
     parent::__construct(sprintf('The given hash for the entity of type "%s" with the id "%s" does not match the current hash.' . ' The entity has probably been edited in the mean time.', $entity, $id), 1102);
 }
Exemplo n.º 16
0
 /**
  * Constructor
  *
  * @param string     $message Error message
  * @param \Exception $prev    Previous Exception
  */
 public function __construct($message = "x-dynamic-key ref-field could not be resolved", $prev = null)
 {
     parent::__construct(Response::HTTP_INTERNAL_SERVER_ERROR, $message, $prev);
 }
 /**
  * Creates a new custom error
  * 
  * @param   [:var] details
  * @param   lang.Throwable cause
  */
 public function __construct($details, $cause = NULL)
 {
     parent::__construct($details['server.message'], $cause);
     $this->details = $details;
 }
Exemplo n.º 18
0
 /**
  * Constructor
  *
  * @param string     $message Error message
  * @param \Exception $prev    Previous Exception
  */
 public function __construct($message = "No Content", $prev = null)
 {
     parent::__construct(Response::HTTP_BAD_REQUEST, $message, $prev);
 }
Exemplo n.º 19
0
 /**
  * Constructor
  *
  * @param FormErrorIterator $errors  Errors from form
  * @param string            $message Error message
  */
 public function __construct(FormErrorIterator $errors, $message = 'Validation failed')
 {
     $this->errors = $errors;
     parent::__construct(Response::HTTP_BAD_REQUEST, $message);
 }
 /**
  * @param string $message
  * @param int $code
  */
 public function __construct($message, $code = 401)
 {
     parent::__construct($message, $code, null);
 }
Exemplo n.º 21
0
 public function __construct($controller, $name)
 {
     parent::__construct(sprintf('Parameter %s has wrong data type in %s', $name, $controller), 0);
     $this->controller = $controller;
     $this->name = $name;
 }
 public function __construct($verb, $url, ValidationResults $validationResults)
 {
     parent::__construct($validationResults->__toString(), $verb, $url);
     $this->validationResults = $validationResults;
 }
Exemplo n.º 23
0
 /**
  * Constructor
  *
  * @param string     $message Error message
  * @param \Exception $prev    Previous Exception
  */
 public function __construct($message = "Invalid JSON Patch", $prev = null)
 {
     parent::__construct(Response::HTTP_BAD_REQUEST, $message, $prev);
 }