class CRM_Contact_Selector_Custom extends CRM_Contact_Selector

This class is used to retrieve and display a range of contacts that match the given criteria (specifically for results of advanced search options.

Constants

CACHE_SIZE

Properties

protected array $_order The sort order which is computed from the columnHeaders from CRM_Core_Selector_Base
protected string $_permission The permission mask for this selector from CRM_Core_Selector_Base
protected string $_key The qfKey of the underlying search from CRM_Core_Selector_Base
$_links This defines two actions- View and Edit.
static array $_columnHeaders We use desc to remind us what that column is, name is used in the tpl
static array $_properties Properties of contact we're interested in displaying
array $_formValues FormValues is the array returned by exportValues called on the HTML_QuickForm_Controller for that page.
protected array $_contextMenu The contextMenu from CRM_Contact_Selector
array $_params Params is the array in a value used by the search query creator
protected array $_returnProperties The return properties used for search from CRM_Contact_Selector
protected int $_action Represent the type of selector
protected $_searchContext from CRM_Contact_Selector
protected $_query
protected int $_ufGroupID Group id from CRM_Contact_Selector
protected array $_fields The public visible fields to be shown to the user
$_search The object that implements the search interface
protected $_customSearchClass

Methods

string
getActionAttribute(string $match, string $attribute = 'name')

This function gets the attribute for the action that.

static 
links()

This method returns the links that are given for each search row.

string
getTemplateFileName(string $action = NULL)

Compose the template file name from the class name.

array
getSortOrder(string $action)

Getter for the sorting direction for the fields which will be displayed on the form.

setPermission($permission)

Setter for permission.

array
getQill()

Get the display text in plain language for the search to display on the results page

null
getSummary()

Get summary.

setKey($key)

No description

string
getKey()

No description

getQueryObject()

Get the query object for this selector.

__construct($customSearchClass, array $formValues = NULL, array $params = NULL, null $returnProperties = NULL, const|int $action = CRM_Core_Action::NONE, bool $includeContactIds = FALSE, bool $searchChildGroups = TRUE, string $searchContext = 'search', null $contextMenu = NULL)

Class constructor.

getPagerParams(string $action, array $params)

Getter for array of the parameters required for creating pager.

array
getColHeads(null $action = NULL, null $output = NULL)

No description

array
getColumnHeaders(string $action = NULL, string $output = NULL)

Returns the column headers as an array of tuples.

int
getTotalCount(string $action)

Returns total number of rows for the query.

int
getRows(string $action, int $offset, int $rowCount, string $sort, string $output = NULL)

Returns all the rows in the given offset and rowCount.

string
buildPrevNextCache(CRM_Utils_Sort $sort)

No description

addActions($rows)

Add actions.

removeActions($rows)

Remove actions.

fillupPrevNextCache(CRM_Utils_Sort $sort, string $cacheKey, int $start, int $end = self::CACHE_SIZE)

No description

rebuildPreNextCache(int $start, int $end, CRM_Utils_Sort $sort, string $cacheKey)

called to rebuild prev next cache using full sql in case of core search ( excluding custom search)

getQILL()

Given the current formValues, gets the query in local language.

string
getExportFileName(string $output = 'csv')

Name of export file.

contactIDQuery(array $params, $action, int $sortID, null $displayRelationshipType = NULL, string $queryOperator = 'AND')

Generate contact ID query.

array
makeProperties($returnProperties)

No description

Details

string getActionAttribute(string $match, string $attribute = 'name')

This function gets the attribute for the action that.

it matches.

Parameters

string $match the action to match against
string $attribute the attribute to return ( name, link, title )

Return Value

string the attribute that matches the action if any

This method returns the links that are given for each search row.

Currently the links added for each row are - View - Edit

in CRM_Core_Selector_Base at line 108
string getTemplateFileName(string $action = NULL)

Compose the template file name from the class name.

Parameters

string $action The action being performed.

Return Value

string template file name

in CRM_Core_Selector_Base at line 120
array getSortOrder(string $action)

Getter for the sorting direction for the fields which will be displayed on the form.

Parameters

string $action the action being performed

Return Value

array the elements that can be sorted along with their properties

in CRM_Core_Selector_Base at line 154
setPermission($permission)

Setter for permission.

Parameters

$permission

in CRM_Core_Selector_Base at line 168
array getQill()

Get the display text in plain language for the search to display on the results page

FIXME: the current internationalisation is bad, but should more or less work on most of "European" languages

Return Value

array array of strings

at line 390
null getSummary()

Get summary.

Return Value

null

in CRM_Core_Selector_Base at line 182
setKey($key)

Parameters

$key

in CRM_Core_Selector_Base at line 189
string getKey()

Return Value

string

in CRM_Contact_Selector at line 133
CRM_Contact_BAO_Query getQueryObject()

Get the query object for this selector.

Return Value

CRM_Contact_BAO_Query

at line 118
CRM_Contact_Selector __construct($customSearchClass, array $formValues = NULL, array $params = NULL, null $returnProperties = NULL, const|int $action = CRM_Core_Action::NONE, bool $includeContactIds = FALSE, bool $searchChildGroups = TRUE, string $searchContext = 'search', null $contextMenu = NULL)

Class constructor.

Parameters

$customSearchClass
array $formValues Array of form values imported.
array $params Array of parameters for query.
null $returnProperties
const|int $action
  • action of search basic or advanced.
bool $includeContactIds
bool $searchChildGroups
string $searchContext
null $contextMenu

Return Value

CRM_Contact_Selector

at line 206
getPagerParams(string $action, array $params)

Getter for array of the parameters required for creating pager.

Parameters

string $action The action being performed.
array $params The array that the pagerParams will be inserted into.

in CRM_Contact_Selector at line 340
array getColHeads(null $action = NULL, null $output = NULL)

Parameters

null $action
null $output

Return Value

array

at line 228
array getColumnHeaders(string $action = NULL, string $output = NULL)

Returns the column headers as an array of tuples.

Keys are name, sortName, key to the sort array.

Parameters

string $action The action being performed.
string $output What should the result set include (web/email/csv).

Return Value

array the column headers that need to be displayed

at line 259
int getTotalCount(string $action)

Returns total number of rows for the query.

Parameters

string $action The action being performed.

Return Value

int the total number of rows for this action

at line 280
int getRows(string $action, int $offset, int $rowCount, string $sort, string $output = NULL)

Returns all the rows in the given offset and rowCount.

Parameters

string $action The action being performed.
int $offset The row number to start from.
int $rowCount The number of rows to return.
string $sort The sql string that describes the sort order.
string $output What should the result set include (web/email/csv).

Return Value

int the total number of rows for this action

in CRM_Contact_Selector at line 846
string buildPrevNextCache(CRM_Utils_Sort $sort)

Parameters

CRM_Utils_Sort $sort

Return Value

string

at line 453
addActions($rows)

Add actions.

Parameters

$rows

at line 480
removeActions($rows)

Remove actions.

Parameters

$rows

in CRM_Contact_Selector at line 1003
fillupPrevNextCache(CRM_Utils_Sort $sort, string $cacheKey, int $start, int $end = self::CACHE_SIZE)

Parameters

CRM_Utils_Sort $sort
string $cacheKey
int $start
int $end

in CRM_Contact_Selector at line 1066
rebuildPreNextCache(int $start, int $end, CRM_Utils_Sort $sort, string $cacheKey)

called to rebuild prev next cache using full sql in case of core search ( excluding custom search)

Parameters

int $start Start for limit clause.
int $end End for limit clause.
CRM_Utils_Sort $sort
string $cacheKey Cache key.

at line 381
getQILL()

Given the current formValues, gets the query in local language.

at line 403
string getExportFileName(string $output = 'csv')

Name of export file.

Parameters

string $output Type of output.

Return Value

string the fileName which we will munge to skip spaces and special characters to avoid various browser issues

in CRM_Contact_Selector at line 1172
CRM_Contact_BAO_Query getQuery()

Return Value

CRM_Contact_BAO_Query

at line 412
CRM_Contact_DAO_Contact alphabetQuery()

Do nothing.

at line 427
CRM_Contact_DAO_Contact contactIDQuery(array $params, $action, int $sortID, null $displayRelationshipType = NULL, string $queryOperator = 'AND')

Generate contact ID query.

Parameters

array $params
$action
int $sortID
null $displayRelationshipType
string $queryOperator

Return Value

CRM_Contact_DAO_Contact

in CRM_Contact_Selector at line 1230
array makeProperties($returnProperties)

Parameters

$returnProperties

Return Value

array