| 
				 public 
				
				
				 | 
			#
			__construct( )
				
Initialize PackageOptions 
				
Initialize PackageOptions Overrides | 
		
			| 
				 public 
				array
				
				 | 
			#
			getValues( integer $option_id )
				
Fetches all package option values (and subsequent pricing) for the given
package option 
				
Fetches all package option values (and subsequent pricing) for the given
package option Parameters
						$option_idinteger$option_id The ID of the option whose values to retrieve
Returns
						arrayA list of package option values, including package option pricings
 
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getGroups( integer $option_id )
				
Fetches all package option groups associated with the given package
option 
				
Fetches all package option groups associated with the given package
option Parameters
						$option_idinteger$option_id The ID of the option whose groups to retrieve
Returns
						arrayA list of package option groups this option value is assigned to
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			get( integer $option_id )
				
Fetches the package option 
				
Fetches the package option Parameters
						$option_idinteger$option_id The ID of the package option to fetch
Returns
						mixedA stdClass object representing the package option, false if no such option
exists
 
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getByPackageId( integer $package_id )
				
Fetches the package options for the given package ID 
				
Fetches the package options for the given package ID Parameters
						$package_idinteger$package_id The ID of the package to fetch options for
Returns
						arrayAn array of stdClass objects, each representing a package option
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getByPricingId( integer $option_pricing_id )
				
Fetches a package option for a specific option pricing ID. Only option
pricing and values associated with the given option pricing ID will be
retrieved. 
				
Fetches a package option for a specific option pricing ID. Only option
pricing and values associated with the given option pricing ID will be
retrieved. Parameters
						$option_pricing_idinteger$option_pricing_id The ID of the package option pricing value whose package
option to fetch
Returns
						mixedAn stdClass object representing the package option, or false if none exist
 
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getAll( integer $company_id )
				
Fetches all package option for a given company 
				
Fetches all package option for a given company Parameters
						$company_idinteger$company_id The company ID
Returns
						arrayAn array of stdClass objects representing each package option
 
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getList( integer $company_id, integer $page = 1, array $order_by = array('name'=>"asc") )
				
Fetches a list of all package options for a given company 
				
Fetches a list of all package options for a given company Parameters
						$company_idinteger$company_id The company ID to fetch package options from
$pageinteger$page The page to return results for
$order_byarray$order_by The sort and order conditions (e.g. array('sort_field'=>"ASC"),
optional)
Returns
						arrayAn array of objects, each representing a package option
 
 | 
		
			| 
				 public 
				integer
				
				 | 
			#
			getListCount( integer $company_id )
				
Returns the total number of packages returned from PackageOptions::getList(),
useful in constructing pagination for the getList() method. 
				
Returns the total number of packages returned from PackageOptions::getList(),
useful in constructing pagination for the getList() method. Parameters
						$company_idinteger$company_id The company ID to fetch package options from
Returns
						integerThe total number of package options
 
 See | 
		
			| 
				 public 
				integer
				
				 | 
			#
			add( array $vars )
				
Adds a package option for the given company 
				
Adds a package option for the given company Parameters
						$varsarray$vars An array of package option info including: - company_id The ID of the
company to assign the option to - label The label displayed for this option -
name The field name for this option - type The field type for this option, one
of: - select - checkbox - radio - quantity - addable 1 if the option is addable
by a client - editable 1 if the option is editable by a client - values A
numerically indexed array of value info including: - name The name of the
package option value (display name) - value The value of the package option
(optional, default null) - min The minimum value if type is 'quantity' - max The
maximum value if type is 'quantity', null for unlimited quantity - step The step
value if type is 'quantity' - pricing A numerically indexed array of pricing
info including: - term The term as an integer 1-65535 (optional, default 1) -
period The period, 'day', 'week', 'month', 'year', 'onetime' (optional, default
'month') - price The price of this term (optional, default 0.00) - setup_fee The
setup fee for this package (optional, default 0.00) - currency The ISO 4217
currency code for this pricing (optional, default USD) - groups An array of
package option group IDs that the option belongs to (optional)
Returns
						integerThe package option ID, void on error
 
 | 
		
			| 
				 public 
				integer
				
				 | 
			#
			edit( array $option_id, array $vars )
				
Updates a package option Parameters
						$option_idarray$vars An array of package option info including: - label The label displayed for
this option - name The field name for this option - type The field type for this
option, one of: - select - checkbox - radio - quantity - addable 1 if the option
is addable by a client - editable 1 if the option is editable by a client -
values A numerically indexed array of value info including: - id The ID of the
package option value to update. If the ID is not given, the option value will be
added. (optional, required for edit) - name The name of the package option value
(display name). If the 'name' is empty or not given, the option value will be
deleted - value The value of the package option (optional, default null) - min
The minimum value if type is 'quantity' - max The maximum value if type is
'quantity', null for unlimited quantity - step The step value if type is
'quantity' - pricing A numerically indexed array of pricing info including: - id
The package option pricing ID to update. If the ID is not given, the pricing
will be added. (optional, required for edit) - term The term as an integer
1-65535 (optional, default 1). If the term is not given along with an ID, the
pricing will be deleted - period The period, 'day', 'week', 'month', 'year',
'onetime' (optional, default 'month') - price The price of this term (optional,
default 0.00) - setup_fee The setup fee for this package (optional, default
0.00) - currency The ISO 4217 currency code for this pricing (optional, default
USD) - groups An array of package option group IDs that the option belongs to
(optional)
$varsReturns
						integerThe package option ID, void on error
 
 | 
		
			| 
				 public 
				
				
				 | 
			#
			delete( integer $option_id )
				
Permanently removes a package option from the system 
				
Permanently removes a package option from the system Parameters
						$option_idinteger$option_group_id The package option ID to delete
 | 
		
			| 
				 public 
				
				
				 | 
			#
			deleteOptionValues( integer $option_id, integer $value_id = null )
				
Deletes all package option values and associated pricing for the given
package option 
				
Deletes all package option values and associated pricing for the given
package option Parameters
						$option_idinteger$option_id The ID of the package option whose values and pricing to delete
$value_idinteger$value_id The ID of the package option value whose value and pricing to delete
(optional)
 | 
		
			| 
				 public 
				
				
				 | 
			#
			removeFromGroup( integer $option_id, array $option_groups )
				
Removes the given package option from the given package option groups 
				
Removes the given package option from the given package option groups Parameters
						$option_idinteger$option_id The ID of the package option
$option_groupsarray$option_groups A numerically-indexed array of package option group IDs of the
package option groups that this option should no longer be assigned to
 | 
		
			| 
				 public 
				
				
				 | 
			#
			orderValues( integer $option_id, array $value_ids )
				
Save the package options values for the given option in the provided
order 
				
Save the package options values for the given option in the provided
order Parameters
						$option_idinteger$option_id The ID of the option to order values for
$value_idsarray$value_ids A numerically indexed array of value IDs
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getTypes( )
				
Retrieves a list of package option types and their language definitions 
				
Retrieves a list of package option types and their language definitions Returns
						arrayA key/value list of types and their language
 
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getPricingPeriods( boolean $plural = false )
				
Retrieves a list of package pricing periods 
				
Retrieves a list of package pricing periods Parameters
						$pluralboolean$plural True to return language for plural periods, false for singular
Returns
						arrayKey=>value pairs of package pricing periods
 
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getValuePricing( integer $value_id )
				
Fetch pricing for the given package option value 
				
Fetch pricing for the given package option value Parameters
						$value_idinteger$value_id The ID of the value to fetch
Returns
						arrayAn array of stdClass object each representing a pricing
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getValuePricingById( integer $pricing_id )
				
Fetch pricing for the given package option pricing ID 
				
Fetch pricing for the given package option pricing ID Parameters
						$pricing_idinteger$pricing_id The ID of option pricing
Returns
						mixedA stdClass object representing the value pricing, false otherwise
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getValue( integer $option_id, string $value )
				
Fetches the value based on the given option_id and value 
				
Fetches the value based on the given option_id and value Parameters
						$option_idinteger$option_id The ID of the option to fetch the value for
$valuestring$value The value to fetch
Returns
						mixedA stdClass object representing the value, false if not such value exists
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getValuePrice( integer $value_id, integer $term, string $period, string $currency, string $convert_currency = null )
				
Fetches pricing for the given option with the given value 
				
Fetches pricing for the given option with the given value Parameters
						$value_idinteger$value_id The ID of the option to fetch
$terminteger$term The term to fetch fields for
$periodstring$period The period to fetch fields for
$currencystring$currency The currency to fetch fields for
$convert_currencystring$convert_currency The currency to convert to (optional)
Returns
						mixedA stdClass object representing the value pricing, false if no such pricing
exists
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getValueProratePrice( integer $value_id, integer $prorate_days, integer $term, string $period, string $currency, string $convert_currency = null )
				
Fetches prorated pricing for the given option with the given value 
				
Fetches prorated pricing for the given option with the given value Deprecated
							since 3.5.0
 Parameters
						$value_idinteger$value_id The ID of the option to fetch
$prorate_daysinteger$prorate_days The number of days to prorate the amount for
$terminteger$term The term to fetch fields for
$periodstring$period The period to fetch fields for
$currencystring$currency The currency to fetch fields for
$convert_currencystring$convert_currency The currency to convert to (optional)
Returns
						mixedA stdClass object representing the value pricing, false if no such pricing
exists
 
 See | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getValueProrateAmount( integer $value_id, string $start_date, integer $term, string $period, integer $pro_rata_day, string $currency, string $convert_currency = null )
				
Fetches prorated pricing for the given option with the given value 
				
Fetches prorated pricing for the given option with the given value Parameters
						$value_idinteger$value_id The ID of the option to fetch
$start_datestring$start_date The start date to prorate the price from
$terminteger$term The term to fetch fields for
$periodstring$period The period to fetch fields for
$pro_rata_dayinteger$pro_rata_day The day of the month to prorate to
$currencystring$currency The currency to fetch fields for
$convert_currencystring$convert_currency The currency to convert to (optional)
Returns
						mixedA stdClass object representing the value pricing, false if no such pricing
exists
 
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getAllByPackageId( integer $package_id, integer $term, string $period, string $currency, string $convert_currency = null, array $options = null )
				
Retrieves all package options for a package given its term, period, and
currency 
				
Retrieves all package options for a package given its term, period, and
currency Parameters
						$package_idinteger$package_id The ID of the package
$terminteger$term The package term
$periodstring$period The package period
$currencystring$currency The pricing currency
$convert_currencystring$convert_currency The currency to convert to (optional, default null)
$optionsarray$options An array of key/value pairs for filtering options (optional, default
null). May include: - addable Set to 1 to only include options that are addable
by clients; 0 to only include options that are NOT addable by clients; otherwise
every option is included - editable Set to 1 to only include options that are
editable by clients; 0 to only include options that are NOT editable by clients;
otherwise every option is included - allow An array of option IDs to include
(i.e. white-list). An empty array would return no options. Not setting this
'option_ids' key will allow any option - disallow An array of option IDs not to
include (i.e. black-list). An empty array would allow all options.
Returns
						arrayAn array of package options including their values and pricing
 
 | 
		
			| 
				 public 
				ModuleFields | 
			#
			getFields( integer $package_id, integer $term, string $period, string $currency, mixed $vars = null, string $convert_currency = null, array $options = null )
				
Get option fields Parameters
						$package_idinteger$package_id The ID of the package to fetch fields for
$terminteger$term The term to fetch fields for
$periodstring$period The period to fetch fields for
$currencystring$currency The currency to fetch fields for
$varsmixed$vars stdClass A stdClass object representing a set of post fields (optional,
default null)
$convert_currencystring$convert_currency The currency to convert to (optional, default null)
$optionsarray$options An array of key/value pairs for filtering options (optional, default
null). May include: - addable Set to 1 to only include options that are addable
by clients; 0 to only include options that are NOT addable by clients; otherwise
every option is included - editable Set to 1 to only include options that are
editable by clients; 0 to only include options that are NOT editable by clients;
otherwise every option is included - allow An array of option IDs to include
(i.e. white-list). An empty array would return no fields. Not setting this
'option_ids' key will allow any option - disallow An array of option IDs not to
include (i.e. black-list). An empty array would allow all options.
Returns
						ModuleFieldsA ModuleFields object, containg the fields to render
					 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			formatPricingTerm( integer $term, string $period )
				
Formats the pricing term Parameters
						$terminteger$term The term length
$periodstring$period The period of this term
Returns
						mixedThe term formatted in accordance to the period, if possible
 
 | 
		
			| 
				 public 
				
				
				 | 
			#
			formatOptions( array $options )
				
Formats options into key/value named pairs where each key is the option field
name from a key/value pair array where each key is the option ID. 
				
Formats options into key/value named pairs where each key is the option field
name from a key/value pair array where each key is the option ID. Parameters
						$optionsarray$options A key/value pair array where each key is the option ID
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			formatServiceOptions( array $options )
				
Formats options into configoption array elements where each key is the option
ID and each value is the option's selected value 
				
Formats options into configoption array elements where each key is the option
ID and each value is the option's selected value Parameters
						$optionsarray$options An array of stdClass objects, each representing a service option and
its option_value
Returns
						arrayAn array that contains configoptions and key/value pairs of option ID and the
option's selected value
 
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			validatePricingTerm( integer $term, string $period )
				
Validates that the term is valid for the period. That is, the term must be
> 0 if the period is something other than "onetime". 
				
Validates that the term is valid for the period. That is, the term must be
> 0 if the period is something other than "onetime". Parameters
						$terminteger$term The Term to validate
$periodstring$period The period to validate the term against
Returns
						booleanTrue if validated, false otherwise
 
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			validatePricingPeriod( string $period )
				
Validates the pricing 'period' field type 
				
Validates the pricing 'period' field type Parameters
						$periodstring$period The period type
Returns
						booleanTrue if validated, false otherwise
 
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			validateValueStep( string $step, string $type )
				
Validates whether the given package option value given has a valid step
set 
				
Validates whether the given package option value given has a valid step
set Parameters
						$stepstring$step The package option step value
$typestring$type The package option type
Returns
						booleanTrue if the package option value has a valid step set, or false otherwise
 
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			validateValueMin( string $min, string $type )
				
Validates whether the given package option value given has a valid minimum
value 
				
Validates whether the given package option value given has a valid minimum
value Parameters
						$minstring$min The package option minimum value
$typestring$type The package option type
Returns
						booleanTrue if the package option value has a valid minimum value set, or false
otherwise
 
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			validateValueMax( string $max, string $type )
				
Validates whether the given package option value given has a valid maximum
value 
				
Validates whether the given package option value given has a valid maximum
value Parameters
						$maxstring$max The package option maximum value
$typestring$type The package option type
Returns
						booleanTrue if the package option value has a valid maximum value set, or false
otherwise
 
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			validateOptionValueLimit( array $values, string $type )
				
Validates whether the number of package option values is valid for the given
package option type 
				
Validates whether the number of package option values is valid for the given
package option type Parameters
						$valuesarray$values A numerically-indexed array of package option values
$typestring$type The package option type
Returns
						booleanTrue if the number of package option values is valid for the given package
option type, or false otherwise
 
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			validateSelectTypeValues( array $values, string $type )
				
Validates whether any of the given package option values contains invalid
special characters for options of the 'select' type. An invalid character is
determined to be one that is not equivalent to its HTML encoded version 
				
Validates whether any of the given package option values contains invalid
special characters for options of the 'select' type. An invalid character is
determined to be one that is not equivalent to its HTML encoded version Parameters
						$valuesarray$values A numerically-indexed array of package option values
$typestring$type The package option type
Returns
						booleanTrue if all package option values contain valid characters, or false otherwise
 
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			validateGroupIds( array $groups, integer $company_id = null )
				
Validates whether all of the given package option group IDs exist and belong
to the given company 
				
Validates whether all of the given package option group IDs exist and belong
to the given company Parameters
						$groupsarray$groups An array of package option group IDs
$company_idinteger$company_id The ID of the company the groups must belong to (optional, default
null)
Returns
						booleanTrue if all of the given package option groups exist and belong to the given
company, or false otherwise
 
 |