Function __global->selectcode_to_idlist_using_db

Definitions

sources/selectcode.php

  • Turn an Selectcode (a filter specifying which records to match) into a list of ID numbers, relying on the database to extract the record-set.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$filter string No No required parameter N/A N/A The filter
$field_name string No No required parameter N/A N/A The database's ID field for the record-set we're matching
$table_name string No No required parameter N/A N/A The database's table for the record-set we're matching
$parent_spec__table_name ?string No No Null N/A N/A The database's table that contains parent/child relationships in the record-set's category-set (the category-set is equal to the record-set if we're matching categories, but not if we're matching entries) (null: don't support subtree [*-style] searches)
$parent_spec__parent_name ?string No No Null N/A N/A The database's field name for the category-set's parent-category-ID (null: don't support subtree [*-style] searches beyond the tree base)
$category_field_name ?string No No Null N/A N/A The database's field name for the record-set's container-category specifier (null: don't support subtree [*-style] searches)
$parent_spec__field_name ?string No No Null N/A N/A The database's field name for the category-set's category-ID (null: don't support subtree [*-style] searches beyond the tree base)
$numeric_record_set_ids boolean No No True N/A N/A Whether the record-set IDs are numeric
$numeric_category_set_ids boolean No No True N/A N/A Whether the category-set IDs are numeric
$db ?object No No Null N/A N/A Database connector to use (null: website)

Returns

  • A list of ID numbers
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Turn an Selectcode (a filter specifying which records to match) into a list of ID numbers, relying on the database to extract the record-set.
 *
 * @param  string $filter The filter
 * @param  string $field_name The database's ID field for the record-set we're matching
 * @param  string $table_name The database's table for the record-set we're matching
 * @param  ?string $parent_spec__table_name The database's table that contains parent/child relationships in the record-set's category-set (the category-set is equal to the record-set if we're matching categories, but not if we're matching entries) (null: don't support subtree [*-style] searches)
 * @param  ?string $parent_spec__parent_name The database's field name for the category-set's parent-category-ID (null: don't support subtree [*-style] searches beyond the tree base)
 * @param  ?string $category_field_name The database's field name for the record-set's container-category specifier (null: don't support subtree [*-style] searches)
 * @param  ?string $parent_spec__field_name The database's field name for the category-set's category-ID (null: don't support subtree [*-style] searches beyond the tree base)
 * @param  boolean $numeric_record_set_ids Whether the record-set IDs are numeric
 * @param  boolean $numeric_category_set_ids Whether the category-set IDs are numeric
 * @param  ?object $db Database connector to use (null: website)
 * @return array A list of ID numbers
 */

function selectcode_to_idlist_using_db(string $filter, string $field_name, string $table_name, ?string $parent_spec__table_name = null, ?string $parent_spec__parent_name = null, ?string $category_field_name = null, ?string $parent_spec__field_name = null, bool $numeric_record_set_ids = true, bool $numeric_category_set_ids = true, ?object $db = null) : array