Get the database query that matches a Fieldtype table’s data with a given value.
Possible template method: If overridden, children do not need to call this method if they update the $query themselves.
Note the following additional properties are available from the $query argument:
$query->field
(Field): Field instance that being referred to match.$query->group
(string): Original group of the field in the selector (when applicable).$query->selector
(Selector): Original Selector object (matching the $field).$query->selectors
(Selectors): Original Selectors object (matching $field and others).$query->parentQuery
(DatabaseQuerySelect): Parent database query that $query will be merged into.$query->pageFinder
(PageFinder): The PageFinder instance that initiated the query, for additional info.
Usage
$pageFinderDatabaseQuerySelect = $fieldtypeModule->getMatchQuery(PageFinderDatabaseQuerySelect $query, string $table, string $subfield, string $operator, mixed $value);
Arguments
Name | Type(s) | Description |
---|---|---|
query | PageFinderDatabaseQuerySelect | |
table | string | The table name to use |
subfield | string | Name of the subfield (typically 'data', unless selector explicitly specified another) |
operator | string | The comparison operator. |
value | mixed | Value to find. |
Return value
PageFinderDatabaseQuerySelect
DatabaseQuerySelect
$query
Exceptions
Method can throw exceptions on error:
WireException
FieldtypeModule methods and properties
API reference based on ProcessWire core version 3.0.236