getQueryParam() public method

Returns a query parameter with a name of $name if it is present in the request, or the $default value otherwise.
public getQueryParam ( string $name, mixed $default = null ) : array | string
$name string
$default mixed
return array | string
Example #1
0
 /**
  * Disables sorting.
  *
  * If the current request contains sorting criteria, it throws a SortingNotSupported exception.
  *
  * @throws \WoohooLabs\Yin\JsonApi\Exception\SortingUnsupported
  */
 public function disableSorting()
 {
     if ($this->request->getQueryParam("sort") !== null) {
         throw $this->exceptionFactory->createSortingUnsupportedException($this->request);
     }
 }