Drahak\Restful\Application\BadRequestException::forbidden PHP Method

forbidden() public static method

Is thrown when access to this resource is forbidden
public static forbidden ( string $message = '', Exception | Throwable $previous = NULL ) : BadRequestException
$message string
$previous Exception | Throwable
return BadRequestException
    public static function forbidden($message = '', $previous = NULL)
    {
        return new self($message, 403, $previous);
    }

Usage Example

Beispiel #1
0
 public function startup()
 {
     if ($this->getAction() !== 'read') {
         throw BadRequestException::forbidden('Stat presenter handles GET requests ONLY.');
     }
     ResourcePresenter::startup();
     $this->series = $this->getParameter('series');
     $this->data = $this->getParameter('data');
     $this->dateBegin = $this->getParameter('dateBegin');
     $this->dateEnd = $this->getParameter('dateEnd');
 }
All Usage Examples Of Drahak\Restful\Application\BadRequestException::forbidden