Mage_Downloadable_Model_Link_Api_Validator
in package
Maho
Tags
Table of Contents
Properties
- $_defaultAttributes : array<string|int, mixed>
- List of all attributes and names endings of validation functions
- $_types : array<string|int, mixed>
- Acceptable resourceTypes array
- $_uploadTypes : array<string|int, mixed>
- Acceptable upload types array
Methods
- completeCheck() : mixed
- Final check
- getResourceTypes() : array<string|int, mixed>
- Get resource types
- validateAttributes() : mixed
- Validate all parameters and loads default values for omitted parameters.
- validateFile() : mixed
- Validate variable, in case of fault loads default entity.
- validateFileDetails() : mixed
- Validate variable, in case of fault throw exception
- validateNumOfDownloads() : mixed
- Validate variable, in case of fault loads default entity.
- validateOrder() : mixed
- Validate variable, in case of fault loads default entity.
- validatePrice() : mixed
- Validate variable, in case of fault loads default entity.
- validateShareable() : mixed
- Validate variable, in case of fault loads default entity.
- validateTitle() : mixed
- Validate variable, in case of fault loads default entity.
- validateType() : bool
- Validate resourceType, it should be one of (links|samples|link_samples)
- validateUnlimited() : mixed
- Validate variable, in case of fault loads default entity.
- validateUploadType() : mixed
- Validate variable, in case of fault loads default entity.
- validateUrl() : mixed
- Validate variable, in case of fault loads default entity.
- _dispatch() : mixed
- Runs all checks.
Properties
$_defaultAttributes
List of all attributes and names endings of validation functions
protected
array<string|int, mixed>
$_defaultAttributes
= ['link' => [
'title' => 'Title',
// $1
'price' => 'Price',
// $2
'number_of_downloads' => 'NumOfDownloads',
// if no set is_unlimited to 1 $3
'is_unlimited' => 'Unlimited',
// 1|0 $4
'is_shareable' => 'Shareable',
// 1|0|2 (2) $5
'type' => 'UploadType',
// file|url (file) $6
'file' => 'File',
// array(name, base64_content) $7
'link_url' => 'Url',
// URL $8
'sort_order' => 'Order',
// int (0) $9
'sample' => [
'type' => 'UploadType',
// file|url (file) $6
'file' => 'File',
// array(name, base64_content) $7
'url' => 'Url',
],
], 'sample' => [
'title' => 'Title',
// $1
'type' => 'UploadType',
// file|url (file) $6
'file' => 'File',
// array(name, base64_content) $7
'sample_url' => 'Url',
// URL $8
'sort_order' => 'Order',
]]
$_types
Acceptable resourceTypes array
protected
array<string|int, mixed>
$_types
= ['link', 'sample']
$_uploadTypes
Acceptable upload types array
protected
array<string|int, mixed>
$_uploadTypes
= ['file', 'url']
Methods
completeCheck()
Final check
public
completeCheck(array<string|int, mixed> &$resource, string $resourceType) : mixed
Parameters
- $resource : array<string|int, mixed>
- $resourceType : string
getResourceTypes()
Get resource types
public
getResourceTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>validateAttributes()
Validate all parameters and loads default values for omitted parameters.
public
validateAttributes(array<string|int, mixed> &$resource, string $resourceType) : mixed
Parameters
- $resource : array<string|int, mixed>
- $resourceType : string
validateFile()
Validate variable, in case of fault loads default entity.
public
validateFile(array<string|int, mixed> &$var) : mixed
Parameters
- $var : array<string|int, mixed>
validateFileDetails()
Validate variable, in case of fault throw exception
public
validateFileDetails(mixed &$var) : mixed
Parameters
- $var : mixed
validateNumOfDownloads()
Validate variable, in case of fault loads default entity.
public
validateNumOfDownloads(int &$var) : mixed
Parameters
- $var : int
validateOrder()
Validate variable, in case of fault loads default entity.
public
validateOrder(int &$var) : mixed
Parameters
- $var : int
validatePrice()
Validate variable, in case of fault loads default entity.
public
validatePrice(float &$var) : mixed
Parameters
- $var : float
validateShareable()
Validate variable, in case of fault loads default entity.
public
validateShareable(int &$var) : mixed
Parameters
- $var : int
validateTitle()
Validate variable, in case of fault loads default entity.
public
validateTitle(string &$var) : mixed
Parameters
- $var : string
validateType()
Validate resourceType, it should be one of (links|samples|link_samples)
public
validateType(string $type) : bool
Parameters
- $type : string
Return values
boolvalidateUnlimited()
Validate variable, in case of fault loads default entity.
public
validateUnlimited(int|bool &$var) : mixed
Parameters
- $var : int|bool
Tags
validateUploadType()
Validate variable, in case of fault loads default entity.
public
validateUploadType(string &$var) : mixed
Parameters
- $var : string
validateUrl()
Validate variable, in case of fault loads default entity.
public
validateUrl(string &$var) : mixed
Parameters
- $var : string
_dispatch()
Runs all checks.
protected
_dispatch(array<string|int, mixed> &$resource, array<string|int, mixed> $fields) : mixed
Parameters
- $resource : array<string|int, mixed>
- $fields : array<string|int, mixed>