Function Fast_custom_index->generate_since_where_clause
Definitions
sources/database_search.php
- Helper function for hooks, used to generate SQL for filtering rows by timestamp.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: string
Parameters
Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
---|---|---|---|---|---|---|---|
$db | object | No | No | required parameter | N/A | N/A | Database connection |
$index_table | string | No | No | required parameter | N/A | N/A | Table containing our custom index |
$since_index_fields | array | No | No | required parameter | N/A | N/A | List of fields which contain timestamps that we use for recency checks |
$since | ?TIME | No | No | required parameter | N/A | N/A | Filter to records with recency since this timestamp (null: no limit) |
&$statistics_map | ?array | Yes | No | Null | N/A | N/A | Write into this map of singular ngram (typically, words) to number of occurrences (null: do not maintain a map) |
Returns
- Extra SQL
- Type: string
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Helper function for hooks, used to generate SQL for filtering rows by timestamp.
*
* @param object $db Database connection
* @param string $index_table Table containing our custom index
* @param array $since_index_fields List of fields which contain timestamps that we use for recency checks
* @param ?TIME $since Filter to records with recency since this timestamp (null: no limit)
* @param ?array $statistics_map Write into this map of singular ngram (typically, words) to number of occurrences (null: do not maintain a map)
* @return string Extra SQL
*/
public function generate_since_where_clause(object $db, string $index_table, array $since_index_fields, ?int $since, ?array &$statistics_map = null) : string
* Helper function for hooks, used to generate SQL for filtering rows by timestamp.
*
* @param object $db Database connection
* @param string $index_table Table containing our custom index
* @param array $since_index_fields List of fields which contain timestamps that we use for recency checks
* @param ?TIME $since Filter to records with recency since this timestamp (null: no limit)
* @param ?array $statistics_map Write into this map of singular ngram (typically, words) to number of occurrences (null: do not maintain a map)
* @return string Extra SQL
*/
public function generate_since_where_clause(object $db, string $index_table, array $since_index_fields, ?int $since, ?array &$statistics_map = null) : string