Function __global->handle_abstract_sorting

Definitions

sources/content.php

  • Remap a simple URL-style sort string with something SQL-compatible. Recognising rating sort order only, but does also support breaking the string down.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$url_sort string No No required parameter N/A N/A The URL sort string
$info array No No required parameter N/A N/A Map of details of our content type
$allowed_sorts ?array No No Null N/A N/A List of allowed sort types (null: default set)
$strict_error boolean No No True N/A N/A Provide a hack-attack error on invalid input

Returns

  • A tuple: The SQL-style sort order, The sort direction, The URL-style sort order
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Remap a simple URL-style sort string with something SQL-compatible. Recognising rating sort order only, but does also support breaking the string down.
 *
 * @param  string $url_sort The URL sort string
 * @param  array $info Map of details of our content type
 * @param  ?array $allowed_sorts List of allowed sort types (null: default set)
 * @param  boolean $strict_error Provide a hack-attack error on invalid input
 * @return array A tuple: The SQL-style sort order, The sort direction, The URL-style sort order
 */

function handle_abstract_sorting(string $url_sort, array $info, ?array $allowed_sorts = null, bool $strict_error = true) : array