/**
* Check if current user is a signed in user.
- * @return bool
*/
function signedInUser(): bool
{
/**
* Check if the current user has general access.
- * @return bool
*/
function hasAppAccess(): bool
{
* Check if the current user has a permission.
* If an ownable element is passed in the jointPermissions are checked against
* that particular item.
- * @param string $permission
- * @param Ownable $ownable
- * @return bool
*/
function userCan(string $permission, Ownable $ownable = null): bool
{
* Generate a url with multiple parameters for sorting purposes.
* Works out the logic to set the correct sorting direction
* Discards empty parameters and allows overriding.
- * @param string $path
- * @param array $data
- * @param array $overrideData
- * @return string
*/
function sortUrl(string $path, array $data, array $overrideData = []): string
{
// Change sorting direction is already sorted on current attribute
if (isset($overrideData['sort']) && $overrideData['sort'] === $data['sort']) {
$queryData['order'] = ($data['order'] === 'asc') ? 'desc' : 'asc';
- } else {
+ } elseif (isset($overrideData['sort'])) {
$queryData['order'] = 'asc';
}