/**
* Method to set an additional URL parameter to be added to all pagination class generated
* links.
*
* @param string $key The name of the URL parameter for which to set a value.
* @param mixed $value The value to set for the URL parameter.
*
* @return mixed The old value for the parameter.
*
* @since 1.6
*/
public function setAdditionalUrlParam($key, $value)
{
// Get the old value to return and set the new one for the URL parameter.
$result = $this->additionalUrlParams[$key] ?? null;
// If the passed parameter value is null unset the parameter, otherwise set it to the given value.
if ($value === null) {
unset($this->additionalUrlParams[$key]);
} else {
$this->additionalUrlParams[$key] = $value;
}
return $result;
}