RecordSearch
final class RecordSearch extends BaseSearch implements RecordSearchInterface (View source)
Runs the record search page query with grouping, comments, sorting and pagination.
Properties
| protected object | $db | from BaseSearch | |
| protected string | $db_type | from BaseSearch | |
| protected ConfigurationInterface | $config | from BaseSearch | |
| protected IPAddressValidator | $ipValidator | from BaseSearch |
Methods
No description
Builds the search string for the given parameters.
The needle for free-text columns. Record content and comments hold whatever the user typed, so the punycoded form of the query cannot match them.
Punycode names whose decoded form contains the query.
Extend a name predicate so partial IDN queries match. Returns the SQL to append, binding one placeholder per matching name into $params.
Restores the original SQL mode for the MySQL database connection if needed.
Search for records based on specified parameters.
Fetch records based on the given search criteria.
Get the total number of records based on the specified parameters.
Whether the last searchRecords() call dropped comment matches because it hit the per-search zone cap.
Get the total number of found records based on the given search criteria.
Details
__construct($db, $config, string $db_type, IPAddressValidator|null $ipValidator = null)
No description
protected array
buildSearchString(array $parameters)
Builds the search string for the given parameters.
protected string
buildRawSearchString(array $parameters)
The needle for free-text columns. Record content and comments hold whatever the user typed, so the punycoded form of the query cannot match them.
protected array
idnNamesMatching(string $table, string $column, string $query)
Punycode names whose decoded form contains the query.
The punycode of a substring is not a substring of the punycode, so a partial query like "munch" can never match "xn--mnchen-3ya" through LIKE. Decoding the IDN names and comparing in PHP is bounded to the rows that are actually punycode.
protected string
idnNameCondition(string $table, string $column, string $query, string $prefix, array $params)
Extend a name predicate so partial IDN queries match. Returns the SQL to append, binding one placeholder per matching name into $params.
protected string
handleSqlMode()
No description
protected void
restoreSqlMode(string $originalSqlMode)
Restores the original SQL mode for the MySQL database connection if needed.
array
searchRecords(array $parameters, string $permission_view, int|null $userId, string $sort_records_by, string $record_sort_direction, bool $iface_search_group_records, int $iface_rowamount, bool $iface_record_comments, int $page = 1)
Search for records based on specified parameters.
array
fetchRecords(array $parameters, mixed $search_string, bool $reverse, mixed $reverse_search_string, string $permission_view, int|null $userId, bool $iface_search_group_records, string $sort_records_by, string $record_sort_direction, int $iface_rowamount, bool $iface_record_comments, int $page)
Fetch records based on the given search criteria.
int
getTotalRecords(array $parameters, string $permission_view, int|null $userId, bool $iface_search_group_records)
Get the total number of records based on the specified parameters.
bool
commentMatchesTruncated()
Whether the last searchRecords() call dropped comment matches because it hit the per-search zone cap.
int
getFoundRecords(array $parameters, mixed $search_string, bool $reverse, mixed $reverse_search_string, string $permission_view, int|null $userId, bool $iface_search_group_records)
Get the total number of found records based on the given search criteria.