ApiValidationComponent
extends Injectable
in package
uses
TraitUploadHelper
Class ApiValidationComponent
Table of Contents
Constants
- ADDITIONAL_RULES_KEY = "belongs"
- const ADDITIONAL_RULES_KEY additional rules key if a validation rules must run on specific value, search on this key
- ADDITIONAL_RULES_VALIDATOR_KEY = "toCheck"
- const ADDITIONAL_RULES_VALIDATOR_KEY if an additional rules system based on another validation, another validation function name searched on this key
- CONFIG_COUNTRY_KEY = "country"
- Country config key
- CONFIG_VAT_NUMBER_KEY = "vatNumber"
- VAT ID config key
- ERROR_MESSAGE_COLUMNS_KEY = "column"
- const ERROR_MESSAGE_COLUMNS_KEY return array wrong column key
- MESSAGE_FROM_CONFIG_KEY = "message"
- const MESSAGE_FROM_CONFIG_KEY if a validator need a special message form config, search with this key
- OR_CONNECT_MINIMUM_KEY = "MINIMUM"
- const OR_CONNECT_MINIMUM_KEY used in checkOrConnect, minimum required number from an array
- TRANS_PARAMS_KEY = "transParams"
- const TRANS_PARAMS_KEY if a translate need parameters return this with this key
Properties
- $cache : mixed
- $content : mixed
- $integrationAlias : mixed
- $rulesFormated : mixed
- $apiUser : mixed
- $nameConverter : ManualOrderUploadHeaderPropertyNameConverter
- $uniqList : mixed
Methods
- __construct() : mixed
- addCache() : self
- Set the value of cache
- addMultiUseCache() : mixed
- if something validated which and maybe need to recheck pass to this, and check this with a simple condition
- addUniq() : self
- Set the value of uniqList
- between() : mixed
- checkAdditionalRules() : mixed
- checkContent() : mixed
- checkDifferent() : mixed
- checkOrConnect() : mixed
- checkRules() : mixed
- dateBetween() : mixed
- dateChecker() : mixed
- email() : mixed
- floatNumber() : mixed
- getAlreadyAdded() : mixed
- if a value already validated or used and not need to recheck
- getCache() : mixed
- Get the value of cache
- getContent() : mixed
- Get the value of content
- getUniqList() : mixed
- Get the value of uniqList
- hellotaxProductValidate() : mixed
- inListValidator() : mixed
- inTable() : mixed
- isEuSellerVatNumber() : mixed
- isNumeric() : mixed
- negativeNumber() : mixed
- notEmpty() : mixed
- positiveNumber() : mixed
- sameAs() : mixed
- setContent() : self
- Set the value of content
- setDefatultValue() : mixed
- upload() : mixed
- validateValue() : mixed
- validVatRate() : mixed
- vatCountryWithVatNumber() : mixed
- dateHasTime() : mixed
- getCacheName() : mixed
- getDateFromString() : mixed
- getHelperParams() : mixed
- rulesHelper() : mixed
- transBackColumnNames() : mixed
- validate() : mixed
- validateExplodedVatid() : mixed
Constants
ADDITIONAL_RULES_KEY
const ADDITIONAL_RULES_KEY additional rules key if a validation rules must run on specific value, search on this key
public
mixed
ADDITIONAL_RULES_KEY
= "belongs"
ADDITIONAL_RULES_VALIDATOR_KEY
const ADDITIONAL_RULES_VALIDATOR_KEY if an additional rules system based on another validation, another validation function name searched on this key
public
mixed
ADDITIONAL_RULES_VALIDATOR_KEY
= "toCheck"
CONFIG_COUNTRY_KEY
Country config key
public
mixed
CONFIG_COUNTRY_KEY
= "country"
CONFIG_VAT_NUMBER_KEY
VAT ID config key
public
mixed
CONFIG_VAT_NUMBER_KEY
= "vatNumber"
ERROR_MESSAGE_COLUMNS_KEY
const ERROR_MESSAGE_COLUMNS_KEY return array wrong column key
public
mixed
ERROR_MESSAGE_COLUMNS_KEY
= "column"
MESSAGE_FROM_CONFIG_KEY
const MESSAGE_FROM_CONFIG_KEY if a validator need a special message form config, search with this key
public
mixed
MESSAGE_FROM_CONFIG_KEY
= "message"
OR_CONNECT_MINIMUM_KEY
const OR_CONNECT_MINIMUM_KEY used in checkOrConnect, minimum required number from an array
public
mixed
OR_CONNECT_MINIMUM_KEY
= "MINIMUM"
TRANS_PARAMS_KEY
const TRANS_PARAMS_KEY if a translate need parameters return this with this key
public
mixed
TRANS_PARAMS_KEY
= "transParams"
Properties
$cache
public
mixed
$cache
= []
$content
public
mixed
$content
= null
$integrationAlias
public
mixed
$integrationAlias
= null
$rulesFormated
public
mixed
$rulesFormated
= []
$apiUser
private
mixed
$apiUser
$nameConverter
private
ManualOrderUploadHeaderPropertyNameConverter
$nameConverter
$uniqList
private
mixed
$uniqList
= []
Methods
__construct()
public
__construct(array<string|int, mixed> $content, User $user[, string $integrationAlias = "api" ]) : mixed
Parameters
- $content : array<string|int, mixed>
- $user : User
- $integrationAlias : string = "api"
addCache()
Set the value of cache
public
addCache(mixed $name, mixed $value) : self
Parameters
- $name : mixed
- $value : mixed
Return values
selfaddMultiUseCache()
if something validated which and maybe need to recheck pass to this, and check this with a simple condition
public
addMultiUseCache(mixed $name, mixed $value) : mixed
Parameters
- $name : mixed
- $value : mixed
addUniq()
Set the value of uniqList
public
addUniq(mixed $value[, mixed $index = null ]) : self
Parameters
- $value : mixed
- $index : mixed = null
Return values
selfbetween()
public
between(mixed $range, mixed $row, mixed $key) : mixed
Parameters
- $range : mixed
- $row : mixed
- $key : mixed
checkAdditionalRules()
public
checkAdditionalRules(mixed $key, mixed $row, mixed $value) : mixed
Parameters
- $key : mixed
- $row : mixed
- $value : mixed
checkContent()
public
checkContent() : mixed
checkDifferent()
public
checkDifferent(mixed $keyList, mixed $row) : mixed
Parameters
- $keyList : mixed
- $row : mixed
checkOrConnect()
public
checkOrConnect(array<string|int, mixed> $checkKeys, array<string|int, mixed> $row) : mixed
Parameters
- $checkKeys : array<string|int, mixed>
- $row : array<string|int, mixed>
checkRules()
public
checkRules(mixed $row[, mixed $rules = [] ]) : mixed
Parameters
- $row : mixed
- $rules : mixed = []
dateBetween()
public
dateBetween(mixed $range, mixed $row, mixed $key) : mixed
Parameters
- $range : mixed
- $row : mixed
- $key : mixed
dateChecker()
public
dateChecker(mixed $key, mixed $row) : mixed
Parameters
- $key : mixed
- $row : mixed
email()
public
email(mixed $key, mixed $row) : mixed
Parameters
- $key : mixed
- $row : mixed
floatNumber()
public
floatNumber(mixed $key, mixed $row, mixed $secondKey) : mixed
Parameters
- $key : mixed
- $row : mixed
- $secondKey : mixed
getAlreadyAdded()
if a value already validated or used and not need to recheck
public
getAlreadyAdded(mixed $name, mixed $value) : mixed
Parameters
- $name : mixed
- $value : mixed
getCache()
Get the value of cache
public
getCache(mixed $name) : mixed
Parameters
- $name : mixed
getContent()
Get the value of content
public
getContent() : mixed
getUniqList()
Get the value of uniqList
public
getUniqList([mixed $index = null ]) : mixed
Parameters
- $index : mixed = null
hellotaxProductValidate()
public
hellotaxProductValidate(mixed $key, mixed $row) : mixed
Parameters
- $key : mixed
- $row : mixed
inListValidator()
public
inListValidator(mixed $list, array<string|int, mixed> $row, mixed $field) : mixed
Parameters
- $list : mixed
- $row : array<string|int, mixed>
- $field : mixed
inTable()
public
inTable(mixed $keyList, mixed $row, mixed $modelName[, mixed $specialIndex = null ]) : mixed
Parameters
- $keyList : mixed
- $row : mixed
- $modelName : mixed
- $specialIndex : mixed = null
isEuSellerVatNumber()
public
isEuSellerVatNumber(mixed $key, mixed $row, mixed $secondKey) : mixed
Parameters
- $key : mixed
- $row : mixed
- $secondKey : mixed
isNumeric()
public
isNumeric(string $key, array<string|int, mixed> $row) : mixed
Parameters
- $key : string
- $row : array<string|int, mixed>
negativeNumber()
public
negativeNumber(mixed $key, mixed $row) : mixed
Parameters
- $key : mixed
- $row : mixed
notEmpty()
public
notEmpty(mixed $key, mixed $row) : mixed
Parameters
- $key : mixed
- $row : mixed
positiveNumber()
public
positiveNumber(mixed $key, mixed $row) : mixed
Parameters
- $key : mixed
- $row : mixed
sameAs()
public
sameAs(mixed $validable, mixed $row) : mixed
Parameters
- $validable : mixed
- $row : mixed
setContent()
Set the value of content
public
setContent(mixed $content) : self
Parameters
- $content : mixed
Return values
selfsetDefatultValue()
public
setDefatultValue(mixed $defaultValue, mixed &$row, mixed $key) : mixed
Parameters
- $defaultValue : mixed
- $row : mixed
- $key : mixed
upload()
public
upload([array<string|int, mixed> $data = [] ]) : mixed
Parameters
- $data : array<string|int, mixed> = []
validateValue()
public
validateValue(mixed $validable, mixed $row, mixed $model) : mixed
Parameters
- $validable : mixed
- $row : mixed
- $model : mixed
validVatRate()
public
validVatRate(mixed $key, mixed $row) : mixed
Parameters
- $key : mixed
- $row : mixed
vatCountryWithVatNumber()
public
vatCountryWithVatNumber(mixed $keyList, mixed $row) : mixed
Parameters
- $keyList : mixed
- $row : mixed
dateHasTime()
private
dateHasTime(string $date) : mixed
Parameters
- $date : string
getCacheName()
private
getCacheName(string $modelName[, mixed $indexedTo = null ]) : mixed
Parameters
- $modelName : string
- $indexedTo : mixed = null
getDateFromString()
private
getDateFromString(string $value) : mixed
Parameters
- $value : string
getHelperParams()
private
getHelperParams(mixed &$keyList) : mixed
Parameters
- $keyList : mixed
rulesHelper()
private
rulesHelper(mixed $ruleName) : mixed
Parameters
- $ruleName : mixed
transBackColumnNames()
private
transBackColumnNames(mixed $keyList[, mixed $transValues = [] ]) : mixed
Parameters
- $keyList : mixed
- $transValues : mixed = []
validate()
private
validate(mixed $model, mixed $function, mixed $value) : mixed
Parameters
- $model : mixed
- $function : mixed
- $value : mixed
validateExplodedVatid()
private
validateExplodedVatid(mixed $valueList) : mixed
Parameters
- $valueList : mixed