Distribution
in package
Provides methods for handling different distribution types
Tags
Table of Contents
Constants
- TYPE_COUPON = 'coupon'
- TYPE_DELIVERY = 'delivery'
- TYPE_DOWNLOAD = 'download'
- TYPE_NONE = 'none'
Properties
- $arrDistributionTypes : array<string|int, mixed>
- The types of distribution
- $defaultDistributionType : string
- The default distribution type
Methods
- getDefault() : string
- Returns the default distribution type as string
- getDistributionDescription() : string
- Get a short description of each distribution type.
- getDistributionMenu() : string
- Returns a string containing the HTML code for the distribution type dropdown menu.
- getDistributionMenuoptions() : string
- Returns a string containing the HTML code for the distribution type dropdown menu options.
- isDistributionType() : bool
- Verifies whether the string argument is the name of a valid Distribution type.
Constants
TYPE_COUPON
public
mixed
TYPE_COUPON
= 'coupon'
TYPE_DELIVERY
public
mixed
TYPE_DELIVERY
= 'delivery'
TYPE_DOWNLOAD
public
mixed
TYPE_DOWNLOAD
= 'download'
TYPE_NONE
public
mixed
TYPE_NONE
= 'none'
Properties
$arrDistributionTypes
The types of distribution
private
static array<string|int, mixed>
$arrDistributionTypes
= array(self::TYPE_DELIVERY, self::TYPE_DOWNLOAD, self::TYPE_NONE, self::TYPE_COUPON)
Tags
$defaultDistributionType
The default distribution type
private
static string
$defaultDistributionType
= 'delivery'
Tags
Methods
getDefault()
Returns the default distribution type as string
public
static getDefault() : string
Tags
Return values
string —The default distribution type
getDistributionDescription()
Get a short description of each distribution type.
public
static getDistributionDescription() : string
Tags
Return values
stringgetDistributionMenu()
Returns a string containing the HTML code for the distribution type dropdown menu.
public
static getDistributionMenu([string $selected = '' ][, string $menuName = 'distribution' ][, mixed $onChange = '' ][, string $selectAttributes = '' ]) : string
Parameters
- $selected : string = ''
-
The distribution type to preselect
- $menuName : string = 'distribution'
-
The name and ID for the select element
- $onChange : mixed = ''
- $selectAttributes : string = ''
-
Optional attributes for the select tag
Tags
Return values
string —The dropdown menu code
getDistributionMenuoptions()
Returns a string containing the HTML code for the distribution type dropdown menu options.
public
static getDistributionMenuoptions([string $selected = '' ]) : string
Parameters
- $selected : string = ''
-
The distribution type to preselect
Tags
Return values
string —The HTML dropdown menu options code
isDistributionType()
Verifies whether the string argument is the name of a valid Distribution type.
public
static isDistributionType(string $string) : bool
Parameters
- $string : string
Tags
Return values
bool —True for valid distribution types, false otherwise