CRM_Utils_Rule
class CRM_Utils_Rule
Class CRM_Utils_Rule
Methods
No description
No description
No description
Validate that a string is a valid MySQL column name or alias.
Validate that a string is ASC or DESC.
Validate that a string is valid order by clause.
No description
No description
No description
No description
No description
No description
No description
No description
No description
Check the validity of the date (in qf format) note that only a year is valid, or a mon-year is also valid in addition to day-mon-year. The date specified has to be beyond today. (i.e today or later)
Check the validity of a date or datetime (timestamp) value which is in YYYYMMDD or YYYYMMDDHHMMSS format
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
allow between 4-6 digits as postal code since india needs 6 and US needs 5 (or if u disregard the first 0, 4 (thanx excel!) FIXME: we need to figure out how to localize such rules
See how file rules are written in HTML/QuickForm/file.php Checks to make sure the uploaded file is ascii
Checks to make sure the uploaded file is in UTF-8, recodes if it's not
See how file rules are written in HTML/QuickForm/file.php Checks to make sure the uploaded file is html
Check if there is a record with the same name in the db.
No description
No description
No description
No description
No description
No description
Determine whether the value contains a valid reference to a directory.
No description
Check the validity of the date (in qf format) note that only a year is valid, or a mon-year is also valid in addition to day-mon-year
No description
Check if the values in the date range are in correct chronological order.
Details
at line 47
static bool
title($str, int $maxLength = 127)
at line 67
static bool
longTitle($str)
at line 76
static bool
variable($str)
at line 97
static bool
mysqlColumnNameOrAlias($str)
Validate that a string is a valid MySQL column name or alias.
at line 126
static bool
mysqlOrderByDirection($str)
Validate that a string is ASC or DESC.
Empty string should be treated as invalid and ignored => default = ASC.
at line 140
static bool
mysqlOrderBy($str)
Validate that a string is valid order by clause.
at line 173
static bool
qfVariable($str)
at line 194
static bool
phone($phone)
at line 212
static bool
query($query)
at line 231
static bool
url($url)
at line 244
static bool
urlish($url)
at line 257
static bool
wikiURL($string)
at line 267
static bool
domain($domain)
at line 281
static null
date($value, null $default = NULL)
at line 296
static null|string
dateTime($value, null $default = NULL)
at line 320
static bool
currentDate(array $date, bool $monthRequired = TRUE)
Check the validity of the date (in qf format) note that only a year is valid, or a mon-year is also valid in addition to day-mon-year. The date specified has to be beyond today. (i.e today or later)
at line 411
static bool
mysqlDate(string $date)
Check the validity of a date or datetime (timestamp) value which is in YYYYMMDD or YYYYMMDDHHMMSS format
Uses PHP checkdate() - params are ( int $month, int $day, int $year )
at line 429
static bool
integer($value)
at line 462
static bool
positiveInteger($value)
at line 485
static bool
numeric($value)
at line 500
static bool
numberOfDigit($value, $noOfDigit)
at line 509
static mixed
cleanMoney($value)
at line 557
static bool
money($value)
at line 586
static bool
string($value, int $maxLength)
at line 600
static bool
boolean($value)
at line 611
static bool
email($value)
at line 620
static bool
emailList($list)
at line 639
static bool
postalCode($value)
allow between 4-6 digits as postal code since india needs 6 and US needs 5 (or if u disregard the first 0, 4 (thanx excel!) FIXME: we need to figure out how to localize such rules
at line 655
static bool
asciiFile(string $elementValue)
See how file rules are written in HTML/QuickForm/file.php Checks to make sure the uploaded file is ascii
at line 672
static bool
utf8File(array $elementValue)
Checks to make sure the uploaded file is in UTF-8, recodes if it's not
at line 702
static bool
htmlFile(array $elementValue)
See how file rules are written in HTML/QuickForm/file.php Checks to make sure the uploaded file is html
at line 722
static bool
objectExists(string $value, array $options)
Check if there is a record with the same name in the db.
at line 737
static bool
optionExists($value, $options)
at line 747
static bool
creditCardNumber($value, $type)
at line 757
static bool
cvv($value, $type)
at line 766
static bool
currencyCode($value)
at line 782
static bool
xssString($value)
at line 798
static bool
fileExists($path)
at line 811
static bool
settingPath(string $path)
Determine whether the value contains a valid reference to a directory.
Paths stored in the setting system may be absolute -- or may be relative to the default data directory.
at line 821
static bool
validContact($value, null $actualElementValue = NULL)
at line 839
static bool
qfDate(array $date)
Check the validity of the date (in qf format) note that only a year is valid, or a mon-year is also valid in addition to day-mon-year
at line 886
static bool
qfKey($key)
at line 902
static
validDateRange(array $fields, $fieldName, $errors, $title)
Check if the values in the date range are in correct chronological order.