ocfilter_to_idlist_using_callback (line 428)
Turn an ocFilter (a filter specifying which records to match) into a list of ID numbers.
array
ocfilter_to_idlist_using_callback
(string $filter, string $ids_and_parents_callback, [?string $parent_spec__table_name = NULL], [?string $parent_spec__parent_name = NULL], [?string $parent_field_name = NULL], [?string $parent_spec__field_name = NULL], [boolean $numeric_record_set_ids = true], [boolean $numeric_category_set_ids = true], [?object $db = NULL])
-
string
$filter: The filter
-
string
$ids_and_parents_callback: A call_user_func_array specifier to a function that will give a map between record-set IDs and record-set parent-category-IDs. We pass a call_user_func_array specifier because we don't want to have to generate it unless we need to (if we need to do 'avoiding' matches or 'subtree' matches)
-
?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)
-
?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)
-
?string
$parent_field_name: The database's field name for the record-set's container-category specifier (NULL: don't support subtree [*-style] searches)
-
?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)
-
boolean
$numeric_record_set_ids: Whether the record-set IDs are numeric
-
boolean
$numeric_category_set_ids: Whether the category-set IDs are numeric
-
?object
$db: Database connection to use (NULL: website)
ocfilter_to_idlist_using_db (line 390)
Turn an ocFilter (a filter specifying which records to match) into a list of ID numbers, relying on the database to extract the record-set.
array
ocfilter_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 $parent_field_name = NULL], [?string $parent_spec__field_name = NULL], [boolean $numeric_record_set_ids = true], [boolean $numeric_category_set_ids = true], [?object $db = NULL])
-
string
$filter: The filter
-
string
$field_name: The database's ID field for the record-set we're matching
-
string
$table_name: The database's table for the record-set we're matching
-
?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)
-
?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)
-
?string
$parent_field_name: The database's field name for the record-set's container-category specifier (NULL: don't support subtree [*-style] searches)
-
?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)
-
boolean
$numeric_record_set_ids: Whether the record-set IDs are numeric
-
boolean
$numeric_category_set_ids: Whether the category-set IDs are numeric
-
?object
$db: Database connection to use (NULL: website)
ocfilter_to_idlist_using_memory (line 409)
Turn an ocFilter (a filter specifying which records to match) into a list of ID numbers, using a prebuilt memory representation of the record-set.
array
ocfilter_to_idlist_using_memory
(string $filter, array $ids_and_parents, [?string $parent_spec__table_name = NULL], [?string $parent_spec__parent_name = NULL], [?string $parent_field_name = NULL], [?string $parent_spec__field_name = NULL], [boolean $numeric_record_set_ids = true], [boolean $numeric_category_set_ids = true], [?object $db = NULL])
-
string
$filter: The filter
-
array
$ids_and_parents: A map between record-set IDs and record-set parent-category-IDs
-
?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)
-
?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)
-
?string
$parent_field_name: The database's field name for the record-set's container-category specifier (NULL: don't support subtree [*-style] searches)
-
?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)
-
boolean
$numeric_record_set_ids: Whether the record-set IDs are numeric
-
boolean
$numeric_category_set_ids: Whether the category-set IDs are numeric
-
?object
$db: Database connection to use (NULL: website)
ocfilter_to_sqlfragment (line 447)
Turn an ocFilter (a filter specifying which records to match) into an SQL query fragment.
string
ocfilter_to_sqlfragment
(string $filter, string $field_name, [?string $parent_spec__table_name = NULL], [?string $parent_spec__parent_name = NULL], [?string $parent_field_name = NULL], [?string $parent_spec__field_name = NULL], [boolean $numeric_record_set_ids = true], [boolean $numeric_category_set_ids = true], [?object $db = NULL])
-
string
$filter: The filter
-
string
$field_name: The database's ID field for the record-set we're matching
-
?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)
-
?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)
-
?string
$parent_field_name: The database's field name for the record-set's container-category specifier (NULL: don't support subtree [*-style] searches)
-
?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)
-
boolean
$numeric_record_set_ids: Whether the record-set IDs are numeric
-
boolean
$numeric_category_set_ids: Whether the category-set IDs are numeric
-
?object
$db: Database connection to use (NULL: website)
_ocfilter_eq (line 74)
Helper function to generate an SQL "equal to" fragment.
string
_ocfilter_eq
(string $field_name, string $var, boolean $numeric)
-
string
$field_name: The field name
-
string
$var: The string value (may actually hold an integer, if $numeric)
-
boolean
$numeric: Whether the value is numeric
_ocfilter_find_ids_and_parents (line 155)
Helper function to fetch a subtree from the database.
array
_ocfilter_find_ids_and_parents
(string $field_name, string $table_name, ?string $parent_field_name, object Database $db)
-
string
$field_name: The ID field name in the record-set
-
string
$table_name: The table name of the record-set
-
?string
$parent_field_name: The database's field name for the category-set's parent-category-ID (NULL: don't support subtree [*-style] searches)
-
object Database
$db: connection to use
_ocfilter_neq (line 55)
Helper function to generate an SQL "not equal to" fragment.
string
_ocfilter_neq
(string $field_name, string $var, boolean $numeric)
-
string
$field_name: The field name
-
string
$var: The string value (may actually hold an integer, if $numeric)
-
boolean
$numeric: Whether the value is numeric
_ocfilter_subtree_fetch (line 98)
Helper function to fetch a subtree from the database.
array
_ocfilter_subtree_fetch
(string $look_under, ?string $table_name, ?string $parent_name, string $field_name, boolean $numeric_ids, object Database $db, array &$cached_mappings, [boolean $first = true])
-
string
$look_under: The category-ID we are searching under
-
?string
$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)
-
?string
$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)
-
string
$field_name: The database's field name for the category-set's category-ID
-
boolean
$numeric_ids: Whether the category-set IDs are numeric
-
object Database
$db: connection to use
-
array
&$cached_mappings: A place to store cached data we've already loaded once in this function. Pass in an NULL variable (not a NULL literal)
-
boolean
$first: Whether this is the base call to this recursive function (just leave it as the default, true)
_ocfilter_to_generic (line 207)
Turn an ocFilter (a filter specifying which records to match) into a list of ID numbers, relying on the database to extract the record-set.
array
_ocfilter_to_generic
(string $filter, ?string $field_name, ?string $table_name, ?array $ids_and_parents, ?mixed $ids_and_parents_callback, ?string $parent_spec__table_name, ?string $parent_spec__parent_name, ?string $parent_field_name, ?string $parent_spec__field_name, boolean $numeric_record_set_ids, boolean $numeric_category_set_ids, ?object $db)
-
string
$filter: The filter
-
?string
$field_name: The database's ID field for the record-set we're matching (NULL: use a different lookup method)
-
?string
$table_name: The database's table for the record-set we're matching (NULL: use a different lookup method)
-
?array
$ids_and_parents: A map between record-set IDs and record-set parent-category-IDs (NULL: use a different lookup method)
-
?mixed
$ids_and_parents_callback: A call_user_func_array specifier to a function that will give a map between record-set IDs and record-set parent-category-IDs. We pass a call_user_func_array specifier because we don't want to have to generate it unless we need to (if we need to do 'avoiding' matches or 'subtree' matches) (NULL: use a different lookup method)
-
?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)
-
?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)
-
?string
$parent_field_name: The database's field name for the record-set's container-category specifier (NULL: don't support subtree [*-style] searches)
-
?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)
-
boolean
$numeric_record_set_ids: Whether the record-set IDs are numeric
-
boolean
$numeric_category_set_ids: Whether the category-set IDs are numeric
-
?object
$db: Database connection to use (NULL: website)
_ocfilter_to_generic_callback (line 179)
Function to do an actual data lookup sourced via the database, used as a kind of a callback function (it's name gets passed into the generic API).
array
_ocfilter_to_generic_callback
(?string $table_name, ?string $field_name, ?string $parent_field_name, boolean $has_no_parents, ?object $db)
-
?string
$table_name: The database's table for the record-set we're matching (NULL: use a different lookup method)
-
?string
$field_name: The database's ID field for the record-set we're matching (NULL: use a different lookup method)
-
?string
$parent_field_name: The database's field name for the record-set's container-category specifier (NULL: don't support subtree [*-style] searches)
-
boolean
$has_no_parents: Whether there are parents in the filter
-
?object
$db: Database connection to use (NULL: website)