class CRM_Contact_Form_Search_Custom_FullText_AbstractPartialQuery

Properties

protected string $name
protected string $label

Methods

__construct(string $name, string $label)

Class constructor.

string
getLabel()

Get label.

string
getName()

Get name.

array
fillTempTable(string $queryText, string $entityIDTableName, string $detailTable, array|NULL $queryLimit, array|NULL $detailLimit)

Execute a query and write out a page worth of matches to $detailTable.

bool
isActive()

No description

fillCustomInfo($tables, $extends)

No description

array
runQueries(string $queryText, array $tables, string $entityIDTableName, int $limit)

Run queries.

string
matchText(string $table, array|string $fullTextFields, string $queryText)

Create a SQL expression for matching against a list of.

moveFileIDs(string $toTable, string $parentIdColumn, array $files)

For any records in $toTable that originated with this query, append file information.

string
toLimit(int|array $limit)

No description

array
parseLimitOffset(array|int $limit)

No description

Details

at line 51
__construct(string $name, string $label)

Class constructor.

Parameters

string $name
string $label

at line 61
string getLabel()

Get label.

Return Value

string

at line 70
string getName()

Get name.

Return Value

string

at line 96
abstract array fillTempTable(string $queryText, string $entityIDTableName, string $detailTable, array|NULL $queryLimit, array|NULL $detailLimit)

Execute a query and write out a page worth of matches to $detailTable.

TODO: Consider removing $entityIDTableName from the function-signature. Each implementation could be responsible for its own temp tables.

TODO: Understand why $queryLimit and $detailLimit are different

Parameters

string $queryText A string of text to search for.
string $entityIDTableName A temporary table into which we can write a list of all matching IDs.
string $detailTable A table into which we can write details about a page worth of matches.
array|NULL $queryLimit overall limit (applied when building $entityIDTableName) NULL if no limit; or array(0 => $limit, 1 => $offset)
array|NULL $detailLimit final limit (applied when building $detailTable) NULL if no limit; or array(0 => $limit, 1 => $offset)

Return Value

array keys: match-descriptor - count: int

at line 101
bool isActive()

Return Value

bool

at line 109
fillCustomInfo($tables, $extends)

Parameters

$tables
$extends

at line 151
array runQueries(string $queryText, array $tables, string $entityIDTableName, int $limit)

Run queries.

Parameters

string $queryText
array $tables A list of places to query. Keys may be:. - sql: an array of SQL queries to execute - final: an array of SQL queries to execute at the end - *: All other keys are treated as table names
string $entityIDTableName
int $limit

Return Value

array Keys: match-descriptor - count: int - files: NULL | array

Exceptions

CRM_Core_Exception

at line 262
string matchText(string $table, array|string $fullTextFields, string $queryText)

Create a SQL expression for matching against a list of.

text columns.

Parameters

string $table Eg "civicrm_note" or "civicrm_note mynote".
array|string $fullTextFields list of field names
string $queryText

Return Value

string SQL, eg "MATCH (col1) AGAINST (queryText)" or "col1 LIKE '%queryText%'"

at line 275
moveFileIDs(string $toTable, string $parentIdColumn, array $files)

For any records in $toTable that originated with this query, append file information.

Parameters

string $toTable
string $parentIdColumn
array $files See return format of CRM_Core_FileSearchInterface::search.

at line 312
string toLimit(int|array $limit)

Parameters

int|array $limit

Return Value

string SQL

See also

CRM_Contact_Form_Search_Custom_FullText::toLimit

at line 331
array parseLimitOffset(array|int $limit)

Parameters

array|int $limit

Return Value

array (0 => $limit, 1 => $offset)