Back to the module list

Verify the values

This class allow to verify the values provided by users easily.
It can check if the value is a date, a number or a Fully Qualified Domain Name

All the methods are available in static or standard mode

The class definition

Class Domframework\Verify

Namespace Domframework

Description

/**
 Permit to check the validity of fields

Properties

No property available

Methods

public function isAllowedChars ( $val, $allowedChars)
/**
 Check if the provided value is only contains the provided chars.
 All the strings must be in UTF-8
 @param string $val The string to test
 @param string $allowedChars The allowed chars

public function isDateSQL ( $val)
/**
 Check if $val is a valid date in SQL
 A valid date is 2014-03-20
 Return true or false
 @param string $val The date to check

public function isDatetimeSQL ( $val)
/**
 Check if $val is a valid date and time in SQL
 A valid date is 2014-03-20 12:27:34
 Return true or false
 @param string $val The date to check

public function isDomain ( $val)
/**
 Check if $val is a valid domain (without hostname)
 Return true or false
 @param string $val The domain to check

public function isEmail ( $val)
/**
 Return true if the provided value is a valid email address
 @param string $val The value to check
 @return boolean

public function isFQDN ( $val)
/**
 Check if $val is a valid FQDN
 Return true or false
 @param string $val The FQDN to check

public function isHash ( $algo, $val)
/**
 Return true if the provided string is a valid hash
 @param string $algo The hash algo to test
 @param string $val The value to test

public function isHostname ( $val)
/**
 Check if $val is a valid hostname (without domain)
 Return true or false
 @param string $val The hostname to check

public function isInteger ( $val)
/**
 Return true if the provided value is an integer in decimal (not octal)
 @param string $val The Integer val to check

public function isIp ( $val)
/**
 Check if $val is a valid IPv4
 Return true or false
 @param string $val The IP to test

public function isIpv4 ( $val)
/**
 Check if $val is a valid IPv4
 Return true or false
 @param string $val The IPv4 to test

public function isIpv6 ( $val)
/**
 Check if $val is a valid IPv6
 Return true or false
 @param string $val The IPv6 to test

public function isURL ( $val)
/**
 Return true if the provided value is a valid URL
 @param string $val The value to check
 @return boolean

public function isUUID ( $val)
/**
 Return true if the provided value is a valid UUID
 %04x%04x-%04x-%04x-%04x-%04x%04x%04x
 @param string $val The value to check
 @return boolean

public function is_FQDN ( $val)
/**
 Check if $val is a valid FQDN
 Return true or false
 @param string $val The FQDN to check
 @deprecated 0.39

public function is_Ip ( $val)
/**
 Check if $val is a valid IPv4
 Return true or false
 @param string $val The IP to test
 @deprecated 0.39

public function is_URL ( $val)
/**
 Return true if the provided value is a valid URL
 @param string $val The value to check
 @return boolean
 @deprecated 0.39

public function is_UUID ( $val)
/**
 Return true if the provided value is a valid UUID
 %04x%04x-%04x-%04x-%04x-%04x%04x%04x
 @param string $val The value to check
 @return boolean
 @deprecated 0.39

public function is_dateSQL ( $val)
/**
 Check if $val is a valid date in SQL
 A valid date is 2014-03-20
 Return true or false
 @param string $val The date to check
 @deprecated 0.39

public function is_datetimeSQL ( $val)
/**
 Check if $val is a valid date and time in SQL
 A valid date is 2014-03-20 12:27:34
 Return true or false
 @param string $val The date to check
 @deprecated 0.39

public function is_domain ( $val)
/**
 Check if $val is a valid domain (without hostname)
 Return true or false
 @param string $val The domain to check
 @deprecated 0.39

public function is_email ( $val)
/**
 Return true if the provided value is a valid email address
 @param string $val The value to check
 @return boolean
 @deprecated 0.39

public function is_hostname ( $val)
/**
 Check if $val is a valid hostname (without domain)
 Return true or false
 @param string $val The hostname to check
 @deprecated 0.39

public function is_integer ( $val)
/**
 Return true if the provided value is an integer in decimal (not octal)
 @param string $val The Integer val to check
 @deprecated 0.39

public function is_ipv4 ( $val)
/**
 Check if $val is a valid IPv4
 Return true or false
 @param string $val The IPv4 to test
 @deprecated 0.39

public function is_ipv6 ( $val)
/**
 Check if $val is a valid IPv6
 Return true or false
 @param string $val The IPv6 to test
 @deprecated 0.39

static public function staticIsAllowedChars ( $val, $allowedChars)
/**
 Check if the provided value is only contains the provided chars.
 In static mode
 All the strings must be in UTF-8
 @param string $val The string to test
 @param string $allowedChars The allowed chars

static public function staticIsDateSQL ( $val)
/**
 Check if $val is a valid date in SQL in static mode
 A valid date is 2014-03-20
 Return true or false
 @param string $val The date to check

static public function staticIsDatetimeSQL ( $val)
/**
 Check if $val is a valid date and time in SQL in static mode
 A valid date is 2014-03-20 12:27:34
 Return true or false
 @param string $val The date to check

static public function staticIsDomain ( $val)
/**
 Check if $val is a valid domain (without hostname) in static mode
 Return true or false
 @param string $val The domain to check

static public function staticIsEmail ( $val)
/**
 Return true if the provided value is a valid email address in static mode
 @param string $val The value to check
 @return boolean

static public function staticIsFQDN ( $val)
/**
 Check if $val is a valid FQDN in static mode
 Return true or false
 @param string $val The FQDN to check

static public function staticIsHash ( $algo, $val)
/**
 Return true if the provided string is a valid hash in static
 @param string $algo The hash algo to test
 @param string $val The value to test

static public function staticIsHostname ( $val)
/**
 Check if $val is a valid hostname (without domain)
 Return true or false
 @param string $val The hostname to check

static public function staticIsInteger ( $val)
/**
 Return true if the provided value is an integer in decimal (not octal)
 In static mode
 @param string $val The Integer val to check

static public function staticIsIp ( $val)
/**
 Check if $val is a valid IPv4 in static mode
 Return true or false
 @param string $val The IP to test

static public function staticIsIpv4 ( $val)
/**
 Check if $val is a valid IPv4 in static mode
 Return true or false
 @param string $val The IPv4 to test

static public function staticIsIpv6 ( $val)
/**
 Check if $val is a valid IPv6 in static mode
 Return true or false
 @param string $val The IPv6 to test

static public function staticIsURL ( $val)
/**
 Return true if the provided value is a valid URL in static mode
 @param string $val The value to check
 @return boolean

static public function staticIsUUID ( $val)
/**
 Return true if the provided value is a valid UUID in static mode
 %04x%04x-%04x-%04x-%04x-%04x%04x%04x
 @param string $val The value to check
 @return boolean

static public function staticIs_FQDN ( $val)
/**
 Check if $val is a valid FQDN in static mode
 Return true or false
 @param string $val The FQDN to check
 @deprecated 0.39

static public function staticIs_URL ( $val)
/**
 Return true if the provided value is a valid URL in static mode
 @param string $val The value to check
 @return boolean
 @deprecated 0.39

static public function staticIs_UUID ( $val)
/**
 Return true if the provided value is a valid UUID in static mode
 %04x%04x-%04x-%04x-%04x-%04x%04x%04x
 @param string $val The value to check
 @return boolean
 @deprecated 0.39

static public function staticIs_dateSQL ( $val)
/**
 Check if $val is a valid date in SQL in static mode
 A valid date is 2014-03-20
 Return true or false
 @param string $val The date to check
 @deprecated 0.39

static public function staticIs_datetimeSQL ( $val)
/**
 Check if $val is a valid date and time in SQL in static mode
 A valid date is 2014-03-20 12:27:34
 Return true or false
 @param string $val The date to check
 @deprecated 0.39

static public function staticIs_domain ( $val)
/**
 Check if $val is a valid domain (without hostname) in static mode
 Return true or false
 @param string $val The domain to check
 @deprecated 0.39

static public function staticIs_email ( $val)
/**
 Return true if the provided value is a valid email address in static mode
 @param string $val The value to check
 @return boolean
 @deprecated 0.39

static public function staticIs_hostname ( $val)
/**
 Check if $val is a valid hostname (without domain)
 Return true or false
 @param string $val The hostname to check
 @deprecated 0.39

static public function staticIs_integer ( $val)
/**
 Return true if the provided value is an integer in decimal (not octal)
 In static mode
 @param string $val The Integer val to check
 @deprecated 0.39

static public function staticIs_ip ( $val)
/**
 Check if $val is a valid IPv4 in static mode
 Return true or false
 @param string $val The IP to test
 @deprecated 0.39

static public function staticIs_ipv4 ( $val)
/**
 Check if $val is a valid IPv4 in static mode
 Return true or false
 @param string $val The IPv4 to test
 @deprecated 0.39

static public function staticIs_ipv6 ( $val)
/**
 Check if $val is a valid IPv6 in static mode
 Return true or false
 @param string $val The IPv6 to test
 @deprecated 0.39