Option extends AbstractDescription
Retrieves item descriptions for package/service options
Table of Contents
Properties
| $date | |
| $options |
Methods
| __construct() | Init |
| get() | Constructs a description from the given meta item |
| _() | Shortcut for Language::_() |
| getProrateFields() | Retrieves a set of proration meta fields used in the descriptions |
| description() | Applies a prefix to the given definition |
| getBaseFields() | Retrieves a set of meta fields used in the descriptions |
| getCancel() | Generates a description from the option meta data for the cancel fee |
| getOption() | Generates a description from the option meta data for the option item |
| getOptionUpdated() | Generates a description from the option meta data for the option item |
| getSetup() | Generates a description from the option meta data for the setup fee |
Methods
__construct()
Init
public
__construct(Date $date[, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $date : Date
- $options : array<string|int, mixed> = []
get()
Constructs a description from the given meta item
public
get(array<string|int, mixed> $meta[, array<string|int, mixed> $oldMeta = null ]) : string
Parameters
- $meta : array<string|int, mixed>
-
An array of meta information representing the item
- $oldMeta : array<string|int, mixed> = null
-
An array of old meta information representing the item (optional, only used to combine the two sets of meta data into a single description)
Return values
string —The description
_()
Shortcut for Language::_()
protected
_(string $name) : mixed
Parameters
- $name : string
-
The name of the language key to fetch
getProrateFields()
Retrieves a set of proration meta fields used in the descriptions
protected
getProrateFields(array<string|int, mixed> $meta) : array<string|int, mixed>
Parameters
- $meta : array<string|int, mixed>
-
An array of meta information
Return values
array<string|int, mixed> —An array of prorate fields
description()
Applies a prefix to the given definition
private
description(string $definition) : string
Parameters
- $definition : string
-
The definition to set a prefix for
Return values
string —The given $definition with a prefix
getBaseFields()
Retrieves a set of meta fields used in the descriptions
private
getBaseFields(array<string|int, mixed> $meta) : array<string|int, mixed>
Parameters
- $meta : array<string|int, mixed>
-
An array of meta information
Return values
array<string|int, mixed> —An array containing the package option name, value, and quantity
getCancel()
Generates a description from the option meta data for the cancel fee
private
getCancel(array<string|int, mixed> $meta[, array<string|int, mixed> $oldMeta = null ]) : string
Parameters
- $meta : array<string|int, mixed>
-
An array of meta information
- $oldMeta : array<string|int, mixed> = null
-
An array of old meta information representing the item (optional, only used to combine the two sets of meta data into a single description)
Return values
string —The description
getOption()
Generates a description from the option meta data for the option item
private
getOption(array<string|int, mixed> $meta[, array<string|int, mixed> $oldMeta = null ]) : string
Parameters
- $meta : array<string|int, mixed>
-
An array of meta information
- $oldMeta : array<string|int, mixed> = null
-
An array of old meta information representing the item (optional, only used to combine the two sets of meta data into a single description)
Return values
string —The description
getOptionUpdated()
Generates a description from the option meta data for the option item
private
getOptionUpdated(array<string|int, mixed> $fields, array<string|int, mixed> $oldFields) : string
Parameters
- $fields : array<string|int, mixed>
-
An array of meta information
- $oldFields : array<string|int, mixed>
-
An array of old meta information representing the item (optional, only used to combine the two sets of meta data into a single description)
Return values
string —The description
getSetup()
Generates a description from the option meta data for the setup fee
private
getSetup(array<string|int, mixed> $meta[, array<string|int, mixed> $oldMeta = null ]) : string
Parameters
- $meta : array<string|int, mixed>
-
An array of meta information
- $oldMeta : array<string|int, mixed> = null
-
An array of old meta information representing the item (optional, only used to combine the two sets of meta data into a single description)
Return values
string —The description