Documentation

Condition
in package

Condition main class.

Table of Contents

DATE_OPERATORS  = ['custom' => ['label' => 'LBL_CUSTOM'], 'smallerthannow' => ['label' => 'LBL_SMALLER_THAN_NOW'], 'greaterthannow' => ['label' => 'LBL_GREATER_THAN_NOW'], 'prevfy' => ['label' => 'LBL_PREVIOUS_FY'], 'thisfy' => ['label' => 'LBL_CURRENT_FY'], 'nextfy' => ['label' => 'LBL_NEXT_FY'], 'prevfq' => ['label' => 'LBL_PREVIOUS_FQ'], 'thisfq' => ['label' => 'LBL_CURRENT_FQ'], 'nextfq' => ['label' => 'LBL_NEXT_FQ'], 'previousworkingday' => ['label' => 'LBL_PREVIOUS_WORKING_DAY'], 'nextworkingday' => ['label' => 'LBL_NEXT_WORKING_DAY'], 'yesterday' => ['label' => 'LBL_YESTERDAY'], 'today' => ['label' => 'LBL_TODAY'], 'untiltoday' => ['label' => 'LBL_UNTIL_TODAY'], 'tomorrow' => ['label' => 'LBL_TOMORROW'], 'lastweek' => ['label' => 'LBL_LAST_WEEK'], 'thisweek' => ['label' => 'LBL_CURRENT_WEEK'], 'nextweek' => ['label' => 'LBL_NEXT_WEEK'], 'lastmonth' => ['label' => 'LBL_LAST_MONTH'], 'thismonth' => ['label' => 'LBL_CURRENT_MONTH'], 'nextmonth' => ['label' => 'LBL_NEXT_MONTH'], 'last7days' => ['label' => 'LBL_LAST_7_DAYS'], 'last15days' => ['label' => 'LBL_LAST_15_DAYS'], 'last30days' => ['label' => 'LBL_LAST_30_DAYS'], 'last60days' => ['label' => 'LBL_LAST_60_DAYS'], 'last90days' => ['label' => 'LBL_LAST_90_DAYS'], 'last120days' => ['label' => 'LBL_LAST_120_DAYS'], 'next15days' => ['label' => 'LBL_NEXT_15_DAYS'], 'next30days' => ['label' => 'LBL_NEXT_30_DAYS'], 'next60days' => ['label' => 'LBL_NEXT_60_DAYS'], 'next90days' => ['label' => 'LBL_NEXT_90_DAYS'], 'next120days' => ['label' => 'LBL_NEXT_120_DAYS'], 'moreThanDaysAgo' => ['label' => 'LBL_DATE_CONDITION_MORE_THAN_DAYS_AGO']]
Data filter list.
OPERATORS_WITHOUT_VALUES  = ['y', 'ny', 'om', 'nom', 'ogr', 'wr', 'nwr', 'hs', 'ro', 'rc', 'nco', 'smallerthannow', 'greaterthannow', 'prevfy', 'thisfy', 'nextfy', 'prevfq', 'thisfq', 'yesterday', 'today', 'untiltoday', 'tomorrow', 'lastweek', 'thisweek', 'nextweek', 'lastmonth', 'thismonth', 'nextmonth', 'last7days', 'last15days', 'last30days', 'last60days', 'last90days', 'last120days', 'next15days', 'next30days', 'next60days', 'next90days', 'next120days', 'previousworkingday', 'nextworkingday']
Operators without values.
STANDARD_OPERATORS  = ['e' => 'LBL_EQUALS', 'n' => 'LBL_NOT_EQUAL_TO', 's' => 'LBL_STARTS_WITH', 'ew' => 'LBL_ENDS_WITH', 'c' => 'LBL_CONTAINS', 'ch' => 'LBL_CONTAINS_HIERARCHY', 'k' => 'LBL_DOES_NOT_CONTAIN', 'kh' => 'LBL_DOES_NOT_CONTAIN_HIERARCHY', 'l' => 'LBL_LESS_THAN', 'g' => 'LBL_GREATER_THAN', 'm' => 'LBL_LESS_THAN_OR_EQUAL', 'h' => 'LBL_GREATER_OR_EQUAL', 'b' => 'LBL_BEFORE', 'a' => 'LBL_AFTER', 'bw' => 'LBL_BETWEEN', 'y' => 'LBL_IS_EMPTY', 'ny' => 'LBL_IS_NOT_EMPTY', 'om' => 'LBL_CURRENTLY_LOGGED_USER', 'nom' => 'LBL_USER_CURRENTLY_NOT_LOGGED', 'ogr' => 'LBL_CURRENTLY_LOGGED_USER_GROUP', 'wr' => 'LBL_IS_WATCHING_RECORD', 'nwr' => 'LBL_IS_NOT_WATCHING_RECORD', 'hs' => 'LBL_HAS_CHANGED', 'hst' => 'LBL_HAS_CHANGED_TO', 'ro' => 'LBL_IS_RECORD_OPEN', 'rc' => 'LBL_IS_RECORD_CLOSED', 'nco' => 'LBL_NOT_CREATED_BY_OWNER']
Supported advanced filter operations.
$recordCache  : array<string|int, Vtiger_Record_Model>
Vtiger_Record_Model instance cache.
checkCondition()  : bool
Check one condition.
checkConditions()  : bool
Check all conditions.
getConditionsFromRequest()  : array<string|int, mixed>
Return condition from request.
getFieldsFromConditions()  : array<string|int, mixed>
Get field names from conditions.
validSearchParams()  : array<string|int, mixed>
Checks structure search_params.
validSearchValue()  : string
Checks value search_value.
parseConditions()  : bool
Parse conditions.

Constants

DATE_OPERATORS

Data filter list.

public mixed DATE_OPERATORS = ['custom' => ['label' => 'LBL_CUSTOM'], 'smallerthannow' => ['label' => 'LBL_SMALLER_THAN_NOW'], 'greaterthannow' => ['label' => 'LBL_GREATER_THAN_NOW'], 'prevfy' => ['label' => 'LBL_PREVIOUS_FY'], 'thisfy' => ['label' => 'LBL_CURRENT_FY'], 'nextfy' => ['label' => 'LBL_NEXT_FY'], 'prevfq' => ['label' => 'LBL_PREVIOUS_FQ'], 'thisfq' => ['label' => 'LBL_CURRENT_FQ'], 'nextfq' => ['label' => 'LBL_NEXT_FQ'], 'previousworkingday' => ['label' => 'LBL_PREVIOUS_WORKING_DAY'], 'nextworkingday' => ['label' => 'LBL_NEXT_WORKING_DAY'], 'yesterday' => ['label' => 'LBL_YESTERDAY'], 'today' => ['label' => 'LBL_TODAY'], 'untiltoday' => ['label' => 'LBL_UNTIL_TODAY'], 'tomorrow' => ['label' => 'LBL_TOMORROW'], 'lastweek' => ['label' => 'LBL_LAST_WEEK'], 'thisweek' => ['label' => 'LBL_CURRENT_WEEK'], 'nextweek' => ['label' => 'LBL_NEXT_WEEK'], 'lastmonth' => ['label' => 'LBL_LAST_MONTH'], 'thismonth' => ['label' => 'LBL_CURRENT_MONTH'], 'nextmonth' => ['label' => 'LBL_NEXT_MONTH'], 'last7days' => ['label' => 'LBL_LAST_7_DAYS'], 'last15days' => ['label' => 'LBL_LAST_15_DAYS'], 'last30days' => ['label' => 'LBL_LAST_30_DAYS'], 'last60days' => ['label' => 'LBL_LAST_60_DAYS'], 'last90days' => ['label' => 'LBL_LAST_90_DAYS'], 'last120days' => ['label' => 'LBL_LAST_120_DAYS'], 'next15days' => ['label' => 'LBL_NEXT_15_DAYS'], 'next30days' => ['label' => 'LBL_NEXT_30_DAYS'], 'next60days' => ['label' => 'LBL_NEXT_60_DAYS'], 'next90days' => ['label' => 'LBL_NEXT_90_DAYS'], 'next120days' => ['label' => 'LBL_NEXT_120_DAYS'], 'moreThanDaysAgo' => ['label' => 'LBL_DATE_CONDITION_MORE_THAN_DAYS_AGO']]

OPERATORS_WITHOUT_VALUES

Operators without values.

public mixed OPERATORS_WITHOUT_VALUES = ['y', 'ny', 'om', 'nom', 'ogr', 'wr', 'nwr', 'hs', 'ro', 'rc', 'nco', 'smallerthannow', 'greaterthannow', 'prevfy', 'thisfy', 'nextfy', 'prevfq', 'thisfq', 'yesterday', 'today', 'untiltoday', 'tomorrow', 'lastweek', 'thisweek', 'nextweek', 'lastmonth', 'thismonth', 'nextmonth', 'last7days', 'last15days', 'last30days', 'last60days', 'last90days', 'last120days', 'next15days', 'next30days', 'next60days', 'next90days', 'next120days', 'previousworkingday', 'nextworkingday']

STANDARD_OPERATORS

Supported advanced filter operations.

public mixed STANDARD_OPERATORS = ['e' => 'LBL_EQUALS', 'n' => 'LBL_NOT_EQUAL_TO', 's' => 'LBL_STARTS_WITH', 'ew' => 'LBL_ENDS_WITH', 'c' => 'LBL_CONTAINS', 'ch' => 'LBL_CONTAINS_HIERARCHY', 'k' => 'LBL_DOES_NOT_CONTAIN', 'kh' => 'LBL_DOES_NOT_CONTAIN_HIERARCHY', 'l' => 'LBL_LESS_THAN', 'g' => 'LBL_GREATER_THAN', 'm' => 'LBL_LESS_THAN_OR_EQUAL', 'h' => 'LBL_GREATER_OR_EQUAL', 'b' => 'LBL_BEFORE', 'a' => 'LBL_AFTER', 'bw' => 'LBL_BETWEEN', 'y' => 'LBL_IS_EMPTY', 'ny' => 'LBL_IS_NOT_EMPTY', 'om' => 'LBL_CURRENTLY_LOGGED_USER', 'nom' => 'LBL_USER_CURRENTLY_NOT_LOGGED', 'ogr' => 'LBL_CURRENTLY_LOGGED_USER_GROUP', 'wr' => 'LBL_IS_WATCHING_RECORD', 'nwr' => 'LBL_IS_NOT_WATCHING_RECORD', 'hs' => 'LBL_HAS_CHANGED', 'hst' => 'LBL_HAS_CHANGED_TO', 'ro' => 'LBL_IS_RECORD_OPEN', 'rc' => 'LBL_IS_RECORD_CLOSED', 'nco' => 'LBL_NOT_CREATED_BY_OWNER']

Properties

$recordCache

Vtiger_Record_Model instance cache.

private static array<string|int, Vtiger_Record_Model> $recordCache = []

Methods

checkCondition()

Check one condition.

public static checkCondition(array<string|int, mixed> $rule, Vtiger_Record_Model $recordModel) : bool
Parameters
$rule : array<string|int, mixed>
$recordModel : Vtiger_Record_Model
Return values
bool

checkConditions()

Check all conditions.

public static checkConditions(array<string|int, mixed> $conditions, Vtiger_Record_Model $recordModel) : bool
Parameters
$conditions : array<string|int, mixed>
$recordModel : Vtiger_Record_Model
Return values
bool

getConditionsFromRequest()

Return condition from request.

public static getConditionsFromRequest(array<string|int, mixed> $conditions) : array<string|int, mixed>
Parameters
$conditions : array<string|int, mixed>
Return values
array<string|int, mixed>

getFieldsFromConditions()

Get field names from conditions.

public static getFieldsFromConditions(array<string|int, mixed> $conditions) : array<string|int, mixed>
Parameters
$conditions : array<string|int, mixed>
Return values
array<string|int, mixed>

['baseModule' => [], 'referenceModule' => []]

validSearchParams()

Checks structure search_params.

public static validSearchParams(string $moduleName, array<string|int, mixed> $searchParams[, bool $convert = true ]) : array<string|int, mixed>
Parameters
$moduleName : string
$searchParams : array<string|int, mixed>
$convert : bool = true
Tags
throws
IllegalValue
Return values
array<string|int, mixed>

validSearchValue()

Checks value search_value.

public static validSearchValue(string $value, string $moduleName, string $fieldName, string $operator) : string
Parameters
$value : string
$moduleName : string
$fieldName : string
$operator : string
Return values
string

parseConditions()

Parse conditions.

private static parseConditions(array<string|int, mixed>|null $conditions, Vtiger_Record_Model $recordModel) : bool
Parameters
$conditions : array<string|int, mixed>|null
$recordModel : Vtiger_Record_Model
Return values
bool

        

Search results