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']]
FIELD_COMPARISON_OPERATORS  = ['ef', 'nf', 'lf', 'gf', 'mf', 'hf']
OPERATORS_WITHOUT_VALUES  = ['y', 'ny', 'om', 'nom', 'ogr', 'wr', 'nwr', 'hs', 'ro', 'rc', 'nco', 'ogu', '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  = ['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', 'ogu' => 'LBL_USERS_GROUP_LOGGED_IN_USER', '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', 'ef' => 'LBL_EQUALS_FIELD', 'nf' => 'LBL_NOT_EQUAL_TO_FIELD', 'lf' => 'LBL_LESS_THAN_FIELD', 'gf' => 'LBL_GREATER_THAN_FIELD', 'mf' => 'LBL_LESS_THAN_OR_EQUAL_FIELD', 'hf' => 'LBL_GREATER_OR_EQUAL_FIELD']
$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.
removeFieldFromCondition()  : array<string|int, mixed>
Remove field from conditions.
validAdvancedConditions()  : array<string|int, mixed>
Checks structure advancedConditions.
validSearchParams()  : array<string|int, mixed>
Checks structure search_params.
validSearchValue()  : string
Checks value search_value.
parseConditions()  : bool
Parse conditions.

Constants

DATE_OPERATORS

public array<string|int, 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']]

Data filter list.

FIELD_COMPARISON_OPERATORS

public array<string|int, string> FIELD_COMPARISON_OPERATORS = ['ef', 'nf', 'lf', 'gf', 'mf', 'hf']

List of field comparison operators

OPERATORS_WITHOUT_VALUES

public array<string|int, string> OPERATORS_WITHOUT_VALUES = ['y', 'ny', 'om', 'nom', 'ogr', 'wr', 'nwr', 'hs', 'ro', 'rc', 'nco', 'ogu', '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

public array<string|int, string> 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', 'ogu' => 'LBL_USERS_GROUP_LOGGED_IN_USER', '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', 'ef' => 'LBL_EQUALS_FIELD', 'nf' => 'LBL_NOT_EQUAL_TO_FIELD', 'lf' => 'LBL_LESS_THAN_FIELD', 'gf' => 'LBL_GREATER_THAN_FIELD', 'mf' => 'LBL_LESS_THAN_OR_EQUAL_FIELD', 'hf' => 'LBL_GREATER_OR_EQUAL_FIELD']

Supported advanced filter operations.

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' => []]

removeFieldFromCondition()

Remove field from conditions.

public static removeFieldFromCondition(string $baseModuleName, array<string|int, mixed> $conditions, string $moduleName, string $fieldName) : array<string|int, mixed>
Parameters
$baseModuleName : string

The base name of the module for which conditions have been set

$conditions : array<string|int, mixed>
$moduleName : string

The module name of the field to be deleted.

$fieldName : string

The name of the field to be deleted

Return values
array<string|int, mixed>

validAdvancedConditions()

Checks structure advancedConditions.

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

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