Helper to manage/check the criteria that are used in things like trophies and user notices.
package | XenForo_Criteria |
---|
getDataForPageCriteriaSelection() : array
Tied with the helper_criteria_page admin template, via $pageCriteriaData.
array
getDataForUserCriteriaSelection() : array
Tied with the helper_criteria_user admin template, via $userCriteriaData.
array
getUserFields()
pageMatchesCriteria(array | string $criteria, boolean $matchOnEmpty, array $params, array $containerData) : boolean
The provided page data takes the form of $params and $containerData from XenForo_ViewRenderer_HtmlPublic::_getNoticesContainerParams().
array
string
List of criteria, format: [] with keys rule and data; may be serialized
boolean
If true and there's no criteria, true is returned; otherwise, false
array
array
boolean
prepareCriteriaForSave(array | string $criteria) : array
Expected input format: [] with children: [rule] => name, [data] => info
array
string
Criteria array or serialize string; see above for format.
array
criteriaprepareCriteriaForSelection(array | string $criteria) : array
This will change if a criteria is repeatable.
array
string
Criteria in format: [], with keys rule and data; may be serialized
array
Format: [rule] => rule data or true if noneunserializeCriteria($criteria)
userMatchesCriteria(array | string $criteria, boolean $matchOnEmpty, array $user) : boolean
The provided user should be a full user record; if fields are missing, an error will not be thrown, and the criteria check will fail.
array
string
List of criteria, format: [] with keys rule and data; may be serialized
boolean
If true and there's no criteria, true is returned; otherwise, false
array
null
Full user record to check against; if null, user visitor
boolean
_arrayStringSearch(string $needleList, string $haystack) : string | boolean
Example: haystack = 'user@gmail.com' needleList = '@yahoo, @gmail, @hotmail'
string
string
string
boolean
Matched needle on success, false on failure$_userFieldPrefix
$_userFieldPrefixLength