public
|
#
__construct( )
Initialize Services
Overrides
|
public
integer
|
#
getStatusCount( integer $client_id, string $status = "active", boolean $children = true )
Returns the number of results available for the given status
Returns the number of results available for the given status
Parameters
- $client_id
integer $client_id The ID of the client to select status count values for
- $status
string $status The status value to select a count of ('active', 'canceled', 'pending',
'suspended')
- $children
boolean $children True to fetch all services, including child services, or false to
fetch only services without a parent (optional, default true)
Returns
integer The number representing the total number of services for this client with that
status
|
public
array
|
#
getList( integer $client_id = null, string $status = "active", integer $page = 1, array $order_by = array('date_added'=>"DESC"), boolean $children = true )
Returns a list of services for the given client and status
Returns a list of services for the given client and status
Parameters
- $client_id
integer $client_id The ID of the client to select services for
- $status
string $status The status to filter by (optional, default "active"), one of: - active
All active services - canceled All canceled services - pending All pending
services - suspended All suspended services - in_review All services that
require manual review before they may become pending - scheduled_cancellation
All services scheduled to be canceled - all All
active/canceled/pending/suspended/in_review
- $page
integer $page The page to return results for (optional, default 1)
- $order_by
array $order_by The sort and order conditions (e.g. array('sort_field'=>"ASC"),
optional)
- $children
boolean $children True to fetch all services, including child services, or false to
fetch only services without a parent (optional, default true)
Returns
array An array of stdClass objects representing services
|
public
integer
|
#
getListCount( integer $client_id, string $status = "active", boolean $children = true )
Returns the total number of services for a client, useful in constructing
pagination for the getList() method.
Returns the total number of services for a client, useful in constructing
pagination for the getList() method.
Parameters
- $client_id
integer $client_id The client ID
- $status
string $status The status type of the services to fetch (optional, default 'active'),
one of: - active All active services - canceled All canceled services - pending
All pending services - suspended All suspended services - in_review All services
that require manual review before they may become pending -
scheduled_cancellation All services scheduled to be canceled - all All
active/canceled/pending/suspended/in_review
- $children
boolean $children True to fetch all services, including child services, or false to
fetch only services without a parent (optional, default true)
Returns
integer The total number of services
See
|
public
array
|
#
search( string $query, integer $page = 1, boolean $search_fields = false )
Search services
Parameters
- $query
string $query The value to search services for
- $page
integer $page The page number of results to fetch (optional, default 1)
- $search_fields
boolean $search_fields If true will also search service fields for the value
Returns
array An array of services that match the search criteria
|
public
|
#
getSearchCount( string $query, mixed $search_fields = false )
Return the total number of services returned from Services::search(), useful
in constructing pagination
Return the total number of services returned from Services::search(), useful
in constructing pagination
Parameters
- $query
string $query The value to search services for
- $search_fields
See
|
public
boolean
|
#
hasParent( integer $service_id )
Determines whether a service has a parent services of the given status
Determines whether a service has a parent services of the given status
Parameters
- $service_id
integer $service_id The ID of the service to check
Returns
boolean True if the service has a parent, false otherwise
|
public
boolean
|
#
hasChildren( integer $service_id, string $status = null )
Determines whether a service has any child services of the given status
Determines whether a service has any child services of the given status
Parameters
- $service_id
integer $service_id The ID of the service to check
- $status
string $status The status of any child services to filter on (e.g. "active",
"canceled", "pending", "suspended", "in_review", or null for any status)
(optional, default null)
Returns
boolean True if the service has children, false otherwise
|
public
array
|
#
getAllChildren( integer $parent_service_id, string $status = "all" )
Retrieves a list of all services that are child of the given parent service
ID
Retrieves a list of all services that are child of the given parent service
ID
Parameters
- $parent_service_id
integer $parent_service_id The ID of the parent service whose child services to fetch
- $status
string $status The status type of the services to fetch (optional, default 'all'): -
active All active services - canceled All canceled services - pending All
pending services - suspended All suspended services - in_review All services
that require manual review before they may become pending -
scheduled_cancellation All services scheduled to be canceled - all All
active/canceled/pending/suspended/in_review
Returns
array A list of stdClass objects representing each child service
|
public
mixed
|
#
getNextInvoiceDate( integer $service_id, string $format = "Y-m-d H:i:s" )
Retrieves the date on which the next invoice is expected to be generated for
a service
Retrieves the date on which the next invoice is expected to be generated for
a service
Parameters
- $service_id
integer $service_id The ID of the service whose next invoice date to fetch
- $format
string $format The date format to return the date in (optional, default 'Y-m-d H:i:s')
Returns
mixed The next expected invoice date in UTC, or null if no further invoices are
expected to be generated
|
public
array
|
#
getAllRenewing( integer $client_group_id )
Retrieves a list of services ready to be renewed for this client group
Retrieves a list of services ready to be renewed for this client group
Parameters
- $client_group_id
integer $client_group_id The client group ID to fetch renewing services from
Returns
array A list of stdClass objects representing services set ready to be renewed
|
public
array
|
#
getAllRenewablePaid( string $date )
Retrieves a list of renewable paid services
Retrieves a list of renewable paid services
Parameters
- $date
string $date The date after which to fetch paid renewable services
Returns
array A list of services that have been paid and may be processed
|
public
array
|
#
getAllPaidPending( integer $client_group_id )
Retrieves a list of paid pending services
Retrieves a list of paid pending services
Parameters
- $client_group_id
integer $client_group_id The ID of the client group whose paid pending invoices to fetch
Returns
array A list of services that have been paid and are still pending
|
public
array
|
#
getAllPendingSuspension( integer $client_group_id, string $suspension_date )
Retrieves a list of services ready to be suspended
Retrieves a list of services ready to be suspended
Parameters
- $client_group_id
integer $client_group_id The ID of the client group
- $suspension_date
string $suspension_date The date before which service would be considered suspended
Returns
array A list of stdClass objects representing services pending suspension
|
public
array
|
#
getAllPendingUnsuspension( integer $client_group_id )
Retrieves a list of paid suspended services ready to be unsuspended. Will
only return services that were automatically suspended (not manually suspended
by a staff member).
Retrieves a list of paid suspended services ready to be unsuspended. Will
only return services that were automatically suspended (not manually suspended
by a staff member).
Parameters
- $client_group_id
integer $client_group_id The ID of the client group
Returns
array A list of stdClass objects representing services pending unsuspension
|
public
array
|
#
getAllPendingCancelation( )
Retrieves a list of services ready to be canceled
Retrieves a list of services ready to be canceled
Returns
array A list of stdClass objects representing services pending cancelation
|
public
array
|
#
searchServiceFields( integer $module_id, string $key, string $value )
Searches services of the given module that contains the given service field
key/value pair.
Searches services of the given module that contains the given service field
key/value pair.
Parameters
- $module_id
integer $module_id The ID of the module to search services on
- $key
string $key They service field key to search
- $value
string $value The service field value to search
Returns
array An array of stdClass objects, each containing a service
|
public
mixed
|
#
getPricingInfo( integer $service_id, string $currency_code = null )
Fetches the pricing information for a service
Fetches the pricing information for a service
Parameters
- $service_id
integer $service_id The ID of the service whose pricing info te fetch
- $currency_code
string $currency_code The ISO 4217 currency code to convert pricing to (optional,
defaults to service's currency)
Returns
mixed An stdClass object representing service pricing fields, or false if none exist
|
public
mixed
|
#
get( integer $service_id )
Fetch a single service, including service field data
Fetch a single service, including service field data
Parameters
- $service_id
integer $service_id The ID of the service to fetch
Returns
mixed A stdClass object representing the service, false if no such service exists
|
public
integer
|
#
add( array $vars, array $packages = null, boolean $notify = false )
Adds a new service to the system
Adds a new service to the system
Parameters
- $vars
array $vars An array of service info including: - parent_service_id The ID of the
service this service is a child of (optional) - package_group_id The ID of the
package group this service was added from (optional) - pricing_id The package
pricing schedule ID for this service - client_id The ID of the client to add the
service under - module_row_id The module row to add the service under (optional,
default module will decide) - coupon_id The ID of the coupon used for this
service (optional) - qty The quanity consumed by this service (optional, default
1) - override_price The price to set for this service, overriding the package
pricing value for the selected term (optional, default null) - override_currency
The currency to set for this service, overriding the package pricing value for
the selected term (optional, default null) - status The status of this service
(optional, default 'pending'): - active - canceled - pending - suspended -
in_review - date_added The date this service is added (default to today's date
UTC) - date_renews The date the service renews (optional, default calculated by
package term) - date_last_renewed The date the service last renewed (optional) -
date_suspended The date the service was last suspended (optional) -
date_canceled The date the service was last canceled (optional) - use_module
Whether or not to use the module when creating the service ('true','false',
default 'true', forced 'false' if status is 'pending' or 'in_review') -
configoptions An array of key/value pairs of package options where the key is
the package option ID and the value is the option value (optional) - * Any other
service field data to pass to the module
- $packages
array $packages A numerically indexed array of packages ordered along with this
service to determine if the given coupon may be applied
- $notify
boolean $notify True to notify the client by email regarding this service creation,
false to not send any notification (optional, default false)
Returns
integer The ID of this service, void if error
|
public
integer
|
#
edit( integer $service_id, array $vars, boolean $bypass_module = false, boolean $notify = false )
Edits a service. Only one module action may be performend at a time. For
example, you can't change the pricing_id and edit the module service fields in a
single request.
Edits a service. Only one module action may be performend at a time. For
example, you can't change the pricing_id and edit the module service fields in a
single request.
Parameters
- $service_id
integer $service_id The ID of the service to edit
- $vars
array $vars An array of service info: - parent_service_id The ID of the service this
service is a child of - package_group_id The ID of the package group this
service was added from - pricing_id The package pricing schedule ID for this
service - client_id The ID of the client this service belongs to - module_row_id
The module row to add the service under - coupon_id The ID of the coupon used
for this service - qty The quanity consumed by this service - override_price The
price to set for this service, overriding the package pricing value for the
selected term (optional, default null) - override_currency The currency to set
for this service, overriding the package pricing value for the selected term
(optional, default null) - status The status of this service: - active -
canceled - pending - suspended - in_review - date_added The date this service is
added - date_renews The date the service renews - date_last_renewed The date the
service last renewed - date_suspended The date the service was last suspended -
date_canceled The date the service was last canceled - use_module Whether or not
to use the module for this request ('true','false', default 'true') - prorate
Whether or not to prorate price changes on upgrades by creating an invoice for
the difference between the new price and the existing price only when updating
the pricing_id to another with an equivalent period (i.e. one-time to one-time
or recurring to recurring period) and no price overrides are set (optional;
'true','false', default 'false') - configoptions An array of key/value pairs of
package options where the key is the package option ID and the value is the
option value. Defining the 'configoptions' key will update all config options.
Always include all config options if setting any, or changing the pricing_id.
(optional) - * Any other service field data to pass to the module
- $bypass_module
boolean $bypass_module $vars['use_module'] notifies the module of whether or not it
should internally use its module connection to process the request, however in
some instances it may be necessary to prevent the module from being notified of
the request altogether. If true, this will prevent the module from being
notified of the request.
- $notify
boolean $notify If true and the service is set to active will send the service
activation notification
Returns
integer The ID of this service, void if error
|
public
|
#
delete( integer $service_id )
Permanently deletes a pending service from the system
Permanently deletes a pending service from the system
Parameters
- $service_id
integer $service_id The ID of the pending service to delete
|
public
|
#
cancel( integer $service_id, array $vars )
Schedule a service for cancellation. All cancellations requests are processed
by the cron.
Schedule a service for cancellation. All cancellations requests are processed
by the cron.
Parameters
- $service_id
integer $service_id The ID of the service to schedule cancellation
- $vars
array $vars An array of service info including: - date_canceled The date the service
is to be canceled. Possible values: - 'end_of_term' Will schedule the service to
be canceled at the end of the current term - date greater than now will schedule
the service to be canceled on that date - date less than now will immediately
cancel the service - use_module Whether or not to use the module when canceling
the service, if canceling now ('true','false', default 'true')
|
public
|
#
unCancel( integer $service_id )
Removes the scheduled cancellation for the given service
Removes the scheduled cancellation for the given service
Parameters
- $service_id
integer $service_id The ID of the service to remove scheduled cancellation from
|
public
|
#
suspend( integer $service_id, array $vars = array() )
Suspends a service
Parameters
- $service_id
integer $service_id The ID of the service to suspend
- $vars
array $vars An array of info including: - use_module Whether or not to use the module
when suspending the service ('true','false', default 'true') - staff_id The ID
of the staff member that issued the service suspension
|
public
|
#
unsuspend( integer $service_id, array $vars = array() )
Unsuspends a service
Parameters
- $service_id
integer $service_id The ID of the service to unsuspend
- $vars
array $vars An array of info including: - use_module Whether or not to use the module
when unsuspending the service ('true','false', default 'true') - staff_id The ID
of the staff member that issued the service unsuspension
|
public
|
#
renew( integer $service_id )
Processes the renewal for the given service by contacting the module (if
supported by the module), to let it know that the service should be renewed.
Note: This method does not affect the renew date of the service in Blesta, it
merely notifies the module; this action takes place after a service has been
paid not when its renew date is bumped.
Processes the renewal for the given service by contacting the module (if
supported by the module), to let it know that the service should be renewed.
Note: This method does not affect the renew date of the service in Blesta, it
merely notifies the module; this action takes place after a service has been
paid not when its renew date is bumped.
Parameters
- $service_id
integer $service_id The ID of the service to process the renewal for
|
public
array
|
#
getStatusTypes( )
Retrieves a list of service status types
Retrieves a list of service status types
Returns
array Key=>value pairs of status types
|
public
array
|
#
getActions( mixed $current_status = null )
Returns all action options that can be performed for a service.
Returns all action options that can be performed for a service.
Returns
array An array of key/value pairs where each key is the action that may be performed
and the value is the friendly name for the action
Parm
string $current_status Set to filter actions that may be performed if the
service is in the given state options include: - active - suspended - canceled
|
public
|
#
setFields( integer $service_id, array $vars )
Updates the field data for the given service, removing all existing data and
replacing it with the given data
Updates the field data for the given service, removing all existing data and
replacing it with the given data
Parameters
- $service_id
integer $service_id The ID of the service to set fields on
- $vars
array $vars A numerically indexed array of field data containing: - key The key for
this field - value The value for this key - encrypted Whether or not this field
should be encrypted ('true', 'false', default 'false')
|
public
|
#
addField( integer $service_id, array $vars )
Adds a service field for a particular service
Adds a service field for a particular service
Parameters
- $service_id
integer $service_id The ID of the service to add to
- $vars
array $vars An array of service field info including: - key The name of the value to
add - value The value to add - encrypted Whether or not to encrypt the value
when storing ('true', 'false', default 'false')
|
public
|
#
editField( integer $service_id, array $vars )
Edit a service field for a particular service
Edit a service field for a particular service
Parameters
- $service_id
integer $service_id The ID of the service to edit
- $vars
array $vars An array of service field info including: - key The name of the value to
edit - value The value to update with - encrypted Whether or not to encrypt the
value when storing ('true', 'false', default 'false')
|
public
array
|
#
getOptions( integer $service_id )
Returns the configurable options for the service
Returns the configurable options for the service
Parameters
- $service_id
integer $service_id
Returns
array An array of stdClass objects, each representing a service option
|
public
|
#
setOptions( integer $service_id, array $config_options )
Sets the configurable options for the service
Sets the configurable options for the service
Deprecated
since 3.5.0
Parameters
- $service_id
integer $service_id The ID of the service to set configurable options for
- $config_options
array $config_options An array of key/value pairs where each key is the option ID and
each value is the value of the option
|
public
array
|
#
getWelcomeEmailTags( )
Returns all default welcome email tags, which are set into the email that is
delivered when a service is provisioned.
Returns all default welcome email tags, which are set into the email that is
delivered when a service is provisioned.
Returns
array A multi-dimensional array of tags where the first dimension is the category and
the second is a numeric array of tags
|
public
string
|
#
getNextRenewDate( string $last_renew_date, integer $term, string $period, string $format = "Y-m-d H:i:s", integer $pro_rata_day = null )
Calculates the next renew date using a given date, term, and period
Calculates the next renew date using a given date, term, and period
Parameters
- $last_renew_date
string $last_renew_date The date the service last renewed. If never renewed this should
be the service add date
- $term
integer $term The term value relating to the given period
- $period
string $period The period (day, week, month, year, onetime)
- $format
string $format The date format to return the date in (optional, default 'Y-m-d H:i:s')
- $pro_rata_day
integer $pro_rata_day The day of the month to prorate to. Only set this value to fetch
the prorated renew date. Only used for month/year periods. Ignored if the
$last_renew_date is on the $pro_rata_day. (optional, default null)
Returns
string The date the service renews in UTC. In the event that the service does not renew
or the renew date can not be calculated null is returned
|
public
array
|
#
buildServiceCouponLineItems( array $services, string $default_currency, array & $coupons, boolean $services_renew = false, array $line_items = array() )
Retrieves a list of coupons to be applied to an invoice for services,
assuming the services given are for a single client only
Retrieves a list of coupons to be applied to an invoice for services,
assuming the services given are for a single client only
Parameters
- $services
array $services An array of stdClass objects, each representing a service
- $default_currency
string $default_currency The ISO 4217 currency code for the client
- $coupons
array $coupons A reference to coupons that will need to be incremented
- $services_renew
boolean $services_renew True if all of the given $services are renewing services, or
false if all $services are new services (optional, default false)
- $line_items
array $line_items An array of line items that the coupon will be applying toward
(optional but highly recommended) - service_id The ID of the service, matching
one of the given $services - description The line item description - qty The
line item quantity - amount The line item amount - tax Whether or not the line
item is taxable - service_option_id The ID of the service option the line item
represents, if any - setup_fee Whether or not the line item is a setup fee -
after_cutoff Whether or not the line item is after the cutoff date
Returns
array An array of coupon line items to append to an invoice
|
public
array
|
#
getItemsFromData( integer $client_id, array $vars )
Retrieves a set of items, discounts, and taxes for a service given data from
which it may be created
Retrieves a set of items, discounts, and taxes for a service given data from
which it may be created
Parameters
- $client_id
integer $client_id The ID of the client the service applies to
- $vars
array $vars An array of input representing a new service data - coupon_id The ID of
the coupon to apply to the service - configoptions An array of key/value pairs
where each key is an option ID and each value is the selected value - pricing_id
The ID of the new pricing selected
Returns
array An array of formatted items, discounts, and taxes from the PricingPresenter: -
items An array of each item, including - price The unit price of the item - qty
The quantity of the item - description The description of the item - discounts
An array of all applying discounts, including - amount The amount of the
discount - type The type of the discount - description A description of the
discount - apply An array of indices referencing items to which the discount
applies - taxes An array of arrays of each tax group containing tax rules that
apply, including: - amount The amount of the tax - type The type of tax -
description The tax description - apply An array of indices referencing items to
which the tax applies
|
public
float
|
#
getRenewalPrice( integer $service_id )
Retrieves the next expected renewal price of a service based on its current
configuration, options, and pricing
Retrieves the next expected renewal price of a service based on its current
configuration, options, and pricing
Parameters
- $service_id
integer $service_id The ID of the service whose renewal pricing to fetch
Returns
float The next expected renewal price
|
protected
array
|
#
getFields( integer $service_id )
Return all field data for the given service, decrypting fields where
neccessary
Return all field data for the given service, decrypting fields where
neccessary
Parameters
- $service_id
integer $service_id The ID of the service to fetch fields for
Returns
array An array of stdClass objects representing fields, containing: - key The service
field name - value The value for this service field - encrypted Whether or not
this field was originally encrypted (1 true, 0 false)
|
public
boolean
|
#
validateStatus( string $status )
Validates a service's 'status' field
Validates a service's 'status' field
Parameters
- $status
string $status The status type
Returns
boolean True if $status is valid, false otherwise
|
public
boolean
|
#
validateUseModule( string $use_module )
Validates whether to use a module when adding/editing a service
Validates whether to use a module when adding/editing a service
Parameters
- $use_module
string $use_module
Returns
boolean True if validated, false otherwise
|
public
|
#
validateEncrypted( string $encrypted )
Validates a service field's 'encrypted' field
Validates a service field's 'encrypted' field
Parameters
- $encrypted
string $encrypted Whether or not to encrypt
|
public
boolean
|
#
validateHasChildren( integer $service_id, string $status = null )
Validates whether the given service has children NOT of the given status
Validates whether the given service has children NOT of the given status
Parameters
- $service_id
integer $service_id The ID of the parent service to validate
- $status
string $status The status of children services to ignore (e.g. "canceled") (optional,
default null to not ignore any child services)
Returns
boolean True if the service has children not of the given status, false otherwise
|
public
array
|
#
getFieldRules( )
Retrieves the rule set for adding/editing service fields
Retrieves the rule set for adding/editing service fields
Returns
array The rules
|
public
|
#
isInstanceOf( mixed $field, mixed $class )
Checks if the given $field is a reference of $class
Checks if the given $field is a reference of $class
|
public
array
|
#
validate( array $vars, array $packages = null )
Performs all validation necessary before adding a service
Performs all validation necessary before adding a service
Parameters
- $vars
array $vars An array of service info including: - parent_service_id The ID of the
service this service is a child of (optional) - package_group_id The ID of the
package group this service was added from (optional) - pricing_id The package
pricing schedule ID for this service - client_id The ID of the client to add the
service under - module_row_id The module row to add the service under (optional,
default is first available) - coupon_id The ID of the coupon used for this
service (optional) - qty The quanity consumed by this service (optional, default
1) - status The status of this service
('active','canceled','pending','suspended', default 'pending') - date_added The
date this service is added (default to today's date UTC) - date_renews The date
the service renews (optional, default calculated by package term) -
date_last_renewed The date the service last renewed (optional) - date_suspended
The date the service was last suspended (optional) - date_canceled The date the
service was last canceled (optional) - use_module Whether or not to use the
module when creating the service ('true','false', default 'true') -
configoptions An array of key/value pairs of package options where the key is
the package option ID and the value is the option value (optional) - * Any other
service field data to pass to the module
- $packages
array $packages A numerically indexed array of packages ordered along with this
service to determine if the given coupon may be applied
Returns
array $vars An array of $vars, modified by error checking
See
|
public
|
#
validateService( stdClass $package, array $vars )
Validates service info, including module options, for creating a service. An
alternative to Services::validate()
Validates service info, including module options, for creating a service. An
alternative to Services::validate()
Parameters
- $package
stdClass
$package A stdClass object representing the package for the service
- $vars
array $vars An array of values to be evaluated, including: - invoice_method The
invoice method to use when creating the service, options are: - create Will
create a new invoice when adding this service - append Will append this service
to an existing invoice (see 'invoice_id') - none Will not create any invoice -
invoice_id The ID of the invoice to append to if invoice_method is set to
'append' - pricing_id The ID of the package pricing to use for this service - *
Any other service field data to pass to the module
See
|
public
boolean
|
#
validateCoupon( integer $coupon_id, array $packages = null )
Verifies if the given coupon ID can be applied to the requested packages
Verifies if the given coupon ID can be applied to the requested packages
Parameters
- $coupon_id
integer $coupon_id The ID of the coupon to validate
- $packages
array An array of pacakges to confirm the coupon can be applied
Returns
boolean True if the coupon can be applied, false otherwise
|
public
boolean
|
#
validateDateCanceled( string $date )
Verifies that the given date value is valid for a cancel date
Verifies that the given date value is valid for a cancel date
Parameters
- $date
string $date The date to cancel a service or "end_of_term" to cancel at the end of the
term
Returns
boolean True if $date is valid, false otherwise
|
public
boolean
|
#
validateDateRenews( string $renew_date, string $last_renew_date = null )
Verifies that the given renew date is greater than the last renew date (if
available)
Verifies that the given renew date is greater than the last renew date (if
available)
Parameters
- $renew_date
string $renew_date The date a service should renew
- $last_renew_date
string $last_renew_date The date a service last renewed
Returns
boolean True if renew date is valid, false otherwise
|
public
boolean
|
#
validatePriceOverride( float $price )
Verifies that the given price override is in a valid format
Verifies that the given price override is in a valid format
Parameters
- $price
float $price The price override
Returns
boolean True if the price is valid, false otherwise
|
public
boolean
|
#
validateOverrideFields( mixed $price, mixed $currency )
Verifies that the given price and currency fields have been set together
Verifies that the given price and currency fields have been set together
Parameters
- $price
mixed $price The price override, or null
- $currency
mixed $currency The currency override, or null
Returns
boolean True if the price and currency have been set properly together, or false
otherwise
|
public
boolean
|
#
validatePricingWithOverrides( integer $pricing_id, integer $service_id, float $price, string $currency )
Verifies that the given service and pricing ID are valid with price
overrides
Verifies that the given service and pricing ID are valid with price
overrides
Parameters
- $pricing_id
integer $pricing_id The ID of the pricing term
- $service_id
integer $service_id The ID of the service being updated
- $price
float $price The price override amount
- $currency
string $currency The price override currency
Returns
boolean True if the pricing ID may be set for this service given the price overrides, or
false otherwise
|
public
boolean
|
#
validateAllowed( integer $client_id, integer $pricing_id )
Verifies that the client has access to the package for the given pricing
ID
Verifies that the client has access to the package for the given pricing
ID
Parameters
- $client_id
integer $client_id The ID of the client
- $pricing_id
integer $pricing_id The ID of the package pricing
Returns
boolean True if the client can add the package, false otherwise
|
public
boolean
|
#
validateConfigOptions( array $config_options, integer $pricing_id )
Verifies that the given package options are valid
Verifies that the given package options are valid
Parameters
- $config_options
array $config_options An array of key/value pairs where each key is the package option
ID and each value is the option value
- $pricing_id
integer $pricing_id The package pricing ID
Returns
boolean True if valid, false otherwise
|
public
boolean
|
#
decrementQuantity( integer $quantity, integer $pricing_id, boolean $check_only = true, mixed $current_qty = null )
Decrements the package quantity if $check_only is false, otherwise only
validates the quantity could be decremented.
Decrements the package quantity if $check_only is false, otherwise only
validates the quantity could be decremented.
Parameters
- $quantity
integer $quantity The quantity requested
- $pricing_id
integer $pricing_id The pricing ID
- $check_only
boolean $check_only True to only verify the quantity could be decremented, false
otherwise
- $current_qty
mixed $current_qty The currenty quantity being consumed by the service
Returns
boolean true if the quantity could be (not necessarily has been) consumed, false
otherwise
|