\ValidateCore

Summary

Methods
Properties
Constants
isIp2Long()
isAnything()
isEmail()
isModuleUrl()
isMd5()
isSha1()
isFloat()
isUnsignedFloat()
isOptFloat()
isCarrierName()
isImageSize()
isName()
isHookName()
isMailName()
isMailSubject()
isModuleName()
isTplName()
isImageTypeName()
isPrice()
isNegativePrice()
isLanguageIsoCode()
isLanguageCode()
isStateIsoCode()
isNumericIsoCode()
isDiscountName()
isCatalogName()
isMessage()
isCountryName()
isLinkRewrite()
isRoutePattern()
isAddress()
isCityName()
isValidSearch()
isGenericName()
isCleanHtml()
isReference()
isPasswd()
isPasswdAdmin()
isConfigName()
isPhpDateFormat()
isDateFormat()
isDate()
isBirthDate()
isBool()
isPhoneNumber()
isEan13()
isUpc()
isPostCode()
isZipCodeFormat()
isOrderWay()
isOrderBy()
isTableOrIdentifier()
isValuesList()
isTagsList()
isProductVisibility()
isInt()
isUnsignedInt()
isPercentage()
isUnsignedId()
isNullOrUnsignedId()
isLoadedObject()
isColor()
isUrl()
isTrackingNumber()
isUrlOrEmpty()
isAbsoluteUrl()
isMySQLEngine()
isUnixName()
isTablePrefix()
isFileName()
isDirName()
isTabName()
isWeightUnit()
isDistanceUnit()
isSubDomainName()
isVoucherDescription()
isSortDirection()
isLabel()
isPriceDisplayMethod()
isDniLite()
isCookie()
isString()
isReductionType()
isBoolId()
isBool_Id()
isLocalizationPackSelection()
isSerializedArray()
isCoordinate()
isLangIsoCode()
isLanguageFileName()
isArrayWithIds()
isSceneZones()
isStockManagement()
isSiret()
isApe()
isControllerName()
isPrestaShopVersion()
isOrderInvoiceNumber()
No public properties found
ADMIN_PASSWORD_LENGTH
PASSWORD_LENGTH
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

ADMIN_PASSWORD_LENGTH

ADMIN_PASSWORD_LENGTH

PASSWORD_LENGTH

PASSWORD_LENGTH

Methods

isIp2Long()

isIp2Long(  $ip) 

Parameters

$ip

isAnything()

isAnything() 

isEmail()

isEmail(string  $email) : boolean

Check for e-mail validity

Parameters

string $email

e-mail address to validate

Returns

boolean —

Validity is ok or not

isModuleUrl()

isModuleUrl(string  $url, array  $errors) : boolean

Check for module URL validity

Parameters

string $url

module URL to validate

array $errors

Reference array for catching errors

Returns

boolean —

Validity is ok or not

isMd5()

isMd5(string  $md5) : boolean

Check for MD5 string validity

Parameters

string $md5

MD5 string to validate

Returns

boolean —

Validity is ok or not

isSha1()

isSha1(string  $sha1) : boolean

Check for SHA1 string validity

Parameters

string $sha1

SHA1 string to validate

Returns

boolean —

Validity is ok or not

isFloat()

isFloat(float  $float) : boolean

Check for a float number validity

Parameters

float $float

Float number to validate

Returns

boolean —

Validity is ok or not

isUnsignedFloat()

isUnsignedFloat(  $float) 

Parameters

$float

isOptFloat()

isOptFloat(float  $float) : boolean

Check for a float number validity

Parameters

float $float

Float number to validate

Returns

boolean —

Validity is ok or not

isCarrierName()

isCarrierName(string  $name) : boolean

Check for a carrier name validity

Parameters

string $name

Carrier name to validate

Returns

boolean —

Validity is ok or not

isImageSize()

isImageSize(string  $size) : boolean

Check for an image size validity

Parameters

string $size

Image size to validate

Returns

boolean —

Validity is ok or not

isName()

isName(string  $name) : boolean

Check for name validity

Parameters

string $name

Name to validate

Returns

boolean —

Validity is ok or not

isHookName()

isHookName(string  $hook) : boolean

Check for hook name validity

Parameters

string $hook

Hook name to validate

Returns

boolean —

Validity is ok or not

isMailName()

isMailName(string  $mail_name) : boolean

Check for sender name validity

Parameters

string $mail_name

Sender name to validate

Returns

boolean —

Validity is ok or not

isMailSubject()

isMailSubject(string  $mail_subject) : boolean

Check for e-mail subject validity

Parameters

string $mail_subject

e-mail subject to validate

Returns

boolean —

Validity is ok or not

isModuleName()

isModuleName(string  $module_name) : boolean

Check for module name validity

Parameters

string $module_name

Module name to validate

Returns

boolean —

Validity is ok or not

isTplName()

isTplName(string  $tpl_name) : boolean

Check for template name validity

Parameters

string $tpl_name

Template name to validate

Returns

boolean —

Validity is ok or not

isImageTypeName()

isImageTypeName(string  $type) : boolean

Check for image type name validity

Parameters

string $type

Image type name to validate

Returns

boolean —

Validity is ok or not

isPrice()

isPrice(string  $price) : boolean

Check for price validity

Parameters

string $price

Price to validate

Returns

boolean —

Validity is ok or not

isNegativePrice()

isNegativePrice(string  $price) : boolean

Check for price validity (including negative price)

Parameters

string $price

Price to validate

Returns

boolean —

Validity is ok or not

isLanguageIsoCode()

isLanguageIsoCode(string  $iso_code) : boolean

Check for language code (ISO) validity

Parameters

string $iso_code

Language code (ISO) to validate

Returns

boolean —

Validity is ok or not

isLanguageCode()

isLanguageCode(  $s) 

Parameters

$s

isStateIsoCode()

isStateIsoCode(  $iso_code) 

Parameters

$iso_code

isNumericIsoCode()

isNumericIsoCode(  $iso_code) 

Parameters

$iso_code

isDiscountName()

isDiscountName(string  $voucher) : boolean

Check for voucher name validity

Parameters

string $voucher

voucher to validate

Returns

boolean —

Validity is ok or not

isCatalogName()

isCatalogName(string  $name) : boolean

Check for product or category name validity

Parameters

string $name

Product or category name to validate

Returns

boolean —

Validity is ok or not

isMessage()

isMessage(string  $message) : boolean

Check for a message validity

Parameters

string $message

Message to validate

Returns

boolean —

Validity is ok or not

isCountryName()

isCountryName(string  $name) : boolean

Check for a country name validity

Parameters

string $name

Country name to validate

Returns

boolean —

Validity is ok or not

isLinkRewrite()

isLinkRewrite(string  $link) : boolean

Check for a link (url-rewriting only) validity

Parameters

string $link

Link to validate

Returns

boolean —

Validity is ok or not

isRoutePattern()

isRoutePattern(string  $pattern) : boolean

Check for a route pattern validity

Parameters

string $pattern

to validate

Returns

boolean —

Validity is ok or not

isAddress()

isAddress(string  $address) : boolean

Check for a postal address validity

Parameters

string $address

Address to validate

Returns

boolean —

Validity is ok or not

isCityName()

isCityName(string  $city) : boolean

Check for city name validity

Parameters

string $city

City name to validate

Returns

boolean —

Validity is ok or not

isValidSearch()

isValidSearch(string  $search) : boolean

Check for search query validity

Parameters

string $search

Query to validate

Returns

boolean —

Validity is ok or not

isGenericName()

isGenericName(string  $name) : boolean

Check for standard name validity

Parameters

string $name

Name to validate

Returns

boolean —

Validity is ok or not

isCleanHtml()

isCleanHtml(string  $html,   $allow_iframe = false) : boolean

Check for HTML field validity (no XSS please !)

Parameters

string $html

HTML field to validate

$allow_iframe

Returns

boolean —

Validity is ok or not

isReference()

isReference(string  $reference) : boolean

Check for product reference validity

Parameters

string $reference

Product reference to validate

Returns

boolean —

Validity is ok or not

isPasswd()

isPasswd(string  $passwd, integer  $size = \Validate::PASSWORD_LENGTH) : boolean

Check for password validity

Parameters

string $passwd

Password to validate

integer $size

Returns

boolean —

Validity is ok or not

isPasswdAdmin()

isPasswdAdmin(  $passwd) 

Parameters

$passwd

isConfigName()

isConfigName(string  $config_name) : boolean

Check for configuration key validity

Parameters

string $config_name

Configuration key to validate

Returns

boolean —

Validity is ok or not

isPhpDateFormat()

isPhpDateFormat(string  $date_format) : boolean

Check date formats like http://php.net/manual/en/function.date.php

Parameters

string $date_format

date format to check

Returns

boolean —

Validity is ok or not

isDateFormat()

isDateFormat(string  $date) : boolean

Check for date format

Parameters

string $date

Date to validate

Returns

boolean —

Validity is ok or not

isDate()

isDate(string  $date) : boolean

Check for date validity

Parameters

string $date

Date to validate

Returns

boolean —

Validity is ok or not

isBirthDate()

isBirthDate(string  $date) : boolean

Check for birthDate validity

Parameters

string $date

birthdate to validate

Returns

boolean —

Validity is ok or not

isBool()

isBool(boolean  $bool) : boolean

Check for boolean validity

Parameters

boolean $bool

Boolean to validate

Returns

boolean —

Validity is ok or not

isPhoneNumber()

isPhoneNumber(string  $number) : boolean

Check for phone number validity

Parameters

string $number

Phone number to validate

Returns

boolean —

Validity is ok or not

isEan13()

isEan13(string  $ean13) : boolean

Check for barcode validity (EAN-13)

Parameters

string $ean13

Barcode to validate

Returns

boolean —

Validity is ok or not

isUpc()

isUpc(string  $upc) : boolean

Check for barcode validity (UPC)

Parameters

string $upc

Barcode to validate

Returns

boolean —

Validity is ok or not

isPostCode()

isPostCode(string  $postcode) : boolean

Check for postal code validity

Parameters

string $postcode

Postal code to validate

Returns

boolean —

Validity is ok or not

isZipCodeFormat()

isZipCodeFormat(string  $zip_code) : boolean

Check for zip code format validity

Parameters

string $zip_code

zip code format to validate

Returns

boolean —

Validity is ok or not

isOrderWay()

isOrderWay(string  $way) : boolean

Check for table or identifier validity Mostly used in database for ordering : ASC / DESC

Parameters

string $way

Keyword to validate

Returns

boolean —

Validity is ok or not

isOrderBy()

isOrderBy(string  $order) : boolean

Check for table or identifier validity Mostly used in database for ordering : ORDER BY field

Parameters

string $order

Field to validate

Returns

boolean —

Validity is ok or not

isTableOrIdentifier()

isTableOrIdentifier(string  $table) : boolean

Check for table or identifier validity Mostly used in database for table names and id_table

Parameters

string $table

Table/identifier to validate

Returns

boolean —

Validity is ok or not

isValuesList()

isValuesList() 

isTagsList()

isTagsList(string  $list) : boolean

Check for tags list validity

Parameters

string $list

List to validate

Returns

boolean —

Validity is ok or not

isProductVisibility()

isProductVisibility(string  $s) : boolean

Check for product visibility

Parameters

string $s

visibility to check

Returns

boolean —

Validity is ok or not

isInt()

isInt(integer  $value) : boolean

Check for an integer validity

Parameters

integer $value

Integer to validate

Returns

boolean —

Validity is ok or not

isUnsignedInt()

isUnsignedInt(integer  $value) : boolean

Check for an integer validity (unsigned)

Parameters

integer $value

Integer to validate

Returns

boolean —

Validity is ok or not

isPercentage()

isPercentage(float  $value) : boolean

Check for an percentage validity (between 0 and 100)

Parameters

float $value

Float to validate

Returns

boolean —

Validity is ok or not

isUnsignedId()

isUnsignedId(integer  $id) : boolean

Check for an integer validity (unsigned) Mostly used in database for auto-increment

Parameters

integer $id

Integer to validate

Returns

boolean —

Validity is ok or not

isNullOrUnsignedId()

isNullOrUnsignedId(  $id) 

Parameters

$id

isLoadedObject()

isLoadedObject(object  $object) : boolean

Check object validity

Parameters

object $object

Object to validate

Returns

boolean —

Validity is ok or not

isColor()

isColor(  $color) : boolean

Check object validity

Parameters

$color

Returns

boolean —

Validity is ok or not

isUrl()

isUrl(string  $url) : boolean

Check url validity (disallowed empty string)

Parameters

string $url

Url to validate

Returns

boolean —

Validity is ok or not

isTrackingNumber()

isTrackingNumber(string  $tracking_number) : boolean

Check tracking number validity (disallowed empty string)

Parameters

string $tracking_number

Tracking number to validate

Returns

boolean —

Validity is ok or not

isUrlOrEmpty()

isUrlOrEmpty(string  $url) : boolean

Check url validity (allowed empty string)

Parameters

string $url

Url to validate

Returns

boolean —

Validity is ok or not

isAbsoluteUrl()

isAbsoluteUrl(string  $url) : boolean

Check if URL is absolute

Parameters

string $url

URL to validate

Returns

boolean —

Validity is ok or not

isMySQLEngine()

isMySQLEngine(  $engine) 

Parameters

$engine

isUnixName()

isUnixName(  $data) 

Parameters

$data

isTablePrefix()

isTablePrefix(  $data) 

Parameters

$data

isFileName()

isFileName(string  $name) : boolean

Check for standard name file validity

Parameters

string $name

Name to validate

Returns

boolean —

Validity is ok or not

isDirName()

isDirName(string  $dir) : boolean

Check for standard name directory validity

Parameters

string $dir

Directory to validate

Returns

boolean —

Validity is ok or not

isTabName()

isTabName(string  $name) : boolean

Check for admin panel tab name validity

Parameters

string $name

Name to validate

Returns

boolean —

Validity is ok or not

isWeightUnit()

isWeightUnit(  $unit) 

Parameters

$unit

isDistanceUnit()

isDistanceUnit(  $unit) 

Parameters

$unit

isSubDomainName()

isSubDomainName(  $domain) 

Parameters

$domain

isVoucherDescription()

isVoucherDescription(  $text) 

Parameters

$text

isSortDirection()

isSortDirection(string  $value) : boolean

Check if the value is a sort direction value (DESC/ASC)

Parameters

string $value

Returns

boolean —

Validity is ok or not

isLabel()

isLabel(string  $label) : boolean

Customization fields' label validity

Parameters

string $label

Returns

boolean —

Validity is ok or not

isPriceDisplayMethod()

isPriceDisplayMethod(integer  $data) : boolean

Price display method validity

Parameters

integer $data

Data to validate

Returns

boolean —

Validity is ok or not

isDniLite()

isDniLite(string  $dni) : boolean

Parameters

string $dni

to validate

Returns

boolean

isCookie()

isCookie(mixed  $data) : boolean

Check if $data is a PrestaShop cookie object

Parameters

mixed $data

to validate

Returns

boolean

isString()

isString(string  $data) : boolean

Price display method validity

Parameters

string $data

Data to validate

Returns

boolean —

Validity is ok or not

isReductionType()

isReductionType(string  $data) : boolean

Check if the data is a reduction type (amout or percentage)

Parameters

string $data

Data to validate

Returns

boolean —

Validity is ok or not

isBoolId()

isBoolId(string  $ids) : boolean

Check for bool_id

Parameters

string $ids

Returns

boolean —

Validity is ok or not

isBool_Id()

isBool_Id(  $ids) 

Parameters

$ids

isLocalizationPackSelection()

isLocalizationPackSelection(string  $data) : boolean

Check the localization pack part selected

Parameters

string $data

Localization pack to check

Returns

boolean —

Validity is ok or not

isSerializedArray()

isSerializedArray(string  $data) : boolean

Check for PHP serialized data

Parameters

string $data

Serialized data to validate

Returns

boolean —

Validity is ok or not

isCoordinate()

isCoordinate(string  $data) : boolean

Check for Latitude/Longitude

Parameters

string $data

Coordinate to validate

Returns

boolean —

Validity is ok or not

isLangIsoCode()

isLangIsoCode(string  $iso_code) : boolean

Check for Language Iso Code

Parameters

string $iso_code

Returns

boolean —

Validity is ok or not

isLanguageFileName()

isLanguageFileName(string  $file_name) : boolean

Check for Language File Name

Parameters

string $file_name

Returns

boolean —

Validity is ok or not

isArrayWithIds()

isArrayWithIds(array  $ids) : boolean

Parameters

array $ids

Returns

boolean —

return true if the array contain only unsigned int value

isSceneZones()

isSceneZones(array  $zones) : boolean

Parameters

array $zones

Returns

boolean —

return true if array contain all value required for an image map zone

isStockManagement()

isStockManagement(array  $stock_management) : boolean

Parameters

array $stock_management

Returns

boolean —

return true if is a valide stock management

isSiret()

isSiret(  $siret) : boolean

Validate SIRET Code

Parameters

$siret

SIRET Code

Returns

boolean —

Return true if is valid

isApe()

isApe(  $ape) : boolean

Validate APE Code

Parameters

$ape

APE Code

Returns

boolean —

Return true if is valid

isControllerName()

isControllerName(  $name) 

Parameters

$name

isPrestaShopVersion()

isPrestaShopVersion(  $version) 

Parameters

$version

isOrderInvoiceNumber()

isOrderInvoiceNumber(  $id) 

Parameters

$id