Documentation

CRM_Contact_Form_Search_Custom_FullText_AbstractPartialQuery
in package

AbstractYes
Tags
copyright

CiviCRM LLC https://civicrm.org/licensing

Table of Contents

Properties

$label  : string
$name  : string

Methods

__construct()  : mixed
Class constructor.
fillCustomInfo()  : mixed
fillTempTable()  : array<string|int, mixed>
Execute a query and write out a page worth of matches to $detailTable.
getLabel()  : string
Get label.
getName()  : string
Get name.
isActive()  : bool
matchText()  : string
Create a SQL expression for matching against a list of.
moveFileIDs()  : mixed
For any records in $toTable that originated with this query, append file information.
parseLimitOffset()  : array<string|int, mixed>
runQueries()  : array<string|int, mixed>
Run queries.
toLimit()  : string

Properties

Methods

__construct()

Class constructor.

public __construct(string $name, string $label) : mixed
Parameters
$name : string
$label : string

fillCustomInfo()

public fillCustomInfo(mixed &$tables, mixed $extends) : mixed
Parameters
$tables : mixed
$extends : mixed

fillTempTable()

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

public abstract fillTempTable(string $queryText, string $entityIDTableName, string $detailTable, array<string|int, mixed>|null $queryLimit, array<string|int, mixed>|null $detailLimit) : array<string|int, mixed>

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
$queryText : string

A string of text to search for.

$entityIDTableName : string

A temporary table into which we can write a list of all matching IDs.

$detailTable : string

A table into which we can write details about a page worth of matches.

$queryLimit : array<string|int, mixed>|null

overall limit (applied when building $entityIDTableName) NULL if no limit; or array(0 => $limit, 1 => $offset)

$detailLimit : array<string|int, mixed>|null

final limit (applied when building $detailTable) NULL if no limit; or array(0 => $limit, 1 => $offset)

Return values
array<string|int, mixed>

keys: match-descriptor

  • count: int

matchText()

Create a SQL expression for matching against a list of.

public matchText(string $table, array<string|int, mixed>|string $fullTextFields, string $queryText) : string

text columns.

Parameters
$table : string

Eg "civicrm_note" or "civicrm_note mynote".

$fullTextFields : array<string|int, mixed>|string

list of field names

$queryText : string
Return values
string

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

moveFileIDs()

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

public moveFileIDs(string $toTable, string $parentIdColumn, array<string|int, mixed> $files) : mixed
Parameters
$toTable : string
$parentIdColumn : string
$files : array<string|int, mixed>

See return format of CRM_Core_FileSearchInterface::search.

parseLimitOffset()

public parseLimitOffset(array<string|int, mixed>|int $limit) : array<string|int, mixed>
Parameters
$limit : array<string|int, mixed>|int
Return values
array<string|int, mixed>

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

runQueries()

Run queries.

public runQueries(string $queryText, array<string|int, mixed> &$tables, string $entityIDTableName, int $limit) : array<string|int, mixed>
Parameters
$queryText : string
$tables : array<string|int, mixed>

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
$entityIDTableName : string
$limit : int
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

Keys: match-descriptor

  • count: int
  • files: NULL | array

toLimit()

public toLimit(int|array<string|int, mixed> $limit) : string
Parameters
$limit : int|array<string|int, mixed>
Tags
see
CRM_Contact_Form_Search_Custom_FullText::toLimit
Return values
string

SQL


        
On this page

Search results