Skip to content
David Pauli edited this page Aug 26, 2016 · 1 revision

The epages REST PHP SDK comes with a Validator, which is used internal to check input values. This Validator can also be used from App developers.

Using the InputValidator object

The validation functions of the InputValidator object will be used in a static way.

if (ep6\InputValidator::isJSON($myJSONString)) {
   // do some stuff if the string is a JSON
}

Possible checks

validation since comment
isArray($array) 0.0.0
isAuthToken($parameter) 0.0.0
isCurrency($parameter) 0.0.0
isEmpty($parameter) 0.0.0 Checks whether a parameter is empty or null. Adjusted in 0.1.0.
isEmptyArray($array) 0.1.0
isEmptyArrayKey($array, $key) 0.1.0 Checks whether an array key is unset or null. Adjusted in 0.2.0.
isExistsArrayKey($array, key) 0.2.0 Checks whether an array key exists. It can be unset or null.
isExistingFile($pathToFile) 0.2.0
isFloat($parameter) 0.1.0
isFormatterType($parameter) 0.2.0 Checks whether a parameter is a FormatterType, see Formatting.
isHost($parameter) 0.0.0
isInt($parameter) 0.0.0
isJSON($parameter) 0.0.0
isLocale($parameter) 0.0.0 Checks whether a parameter is a localization string (like de_DE).
isLogLevel($parameter) 0.0.0 Checks whether a parameter is a log level., see Logging. Adjusted in 0.1.0.
isProductDirection($parameter) 0.0.0 Checks whether a parameter is a product sort direction.
isProductId($parameter) 0.0.0
isProductSort($parameter) 0.0.0
isOutputRessource($parameter) 0.0.0 Checks whether a parameter is an output ressource, see Logging. Adjusted in 0.1.0 and 0.1.2.
isRangedFloat($parameter, minimum, maximum) 0.1.0 Checks whether a parameter is a float with a range. Minimum and maximum can be null and leave out.
isRangedInt($parameter, minimum, maximum) 0.0.0 Checks whether a parameter is a int with a range. Minimum and maximum can be null and leave out.
isRequestMethod($parameter) 0.0.0 Adjusted in 0.1.0.
isShop($parameter) 0.0.0
isString($parameter) 0.1.2