Function __global->selectcode_to_sqlfragment

Definitions

sources/selectcode.php

  • Turn an Selectcode (a filter specifying which records to match) into an SQL query fragment.
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Return: string

Parameters

Name Type Default Set Range Description
$filter string required parameter N/A N/A The filter
$field_name string required parameter N/A N/A The database's ID field for the record-set we're matching. E.g. 'id'.
$parent_spec__table_name ?string 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). E.g. 'categories'.
$parent_spec__parent_name ?string 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). E.g. 'parent_id'.
$category_field_name ?string 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). E.g. 'cat'.
$parent_spec__field_name ?string 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). E.g. 'id'.
$numeric_record_set_ids boolean True N/A N/A Whether the record-set IDs are numeric
$numeric_category_set_ids boolean True N/A N/A Whether the category-set IDs are numeric
$db ?object Null N/A N/A Database connector to use (null: website)

Return

  • SQL query fragment. Note that parentheses will be put around this automatically if required, so there's no need to do this yourself.
  • Type: string
  • Set: N/A
  • Range: N/A