Class ServiceChanges
Service upgrades/downgrades
-
Model
-
AppModel
uses
Blesta\Core\Util\Common\Traits\Container
-
ServiceChanges
Methods summary
public
|
#
__construct( )
Initialize language
Overrides
|
public
integer
|
#
add( $service_id, $invoice_id, array $vars )
Queues a pending service change entry
Queues a pending service change entry
Parameters
- $service_id
- service ID
- $invoice_id
- ID of the invoice
- $vars
An array of information including:
- data An array of input data used later to process the service change
Returns
integer The service change ID on success, or void on failure
|
public
|
#
edit( integer $service_change_id, array $vars )
Updates a service change entry
Updates a service change entry
Parameters
- $service_change_id
- The ID of the service change to update
- $vars
An array of fields to update:
- status The service change status (one of: 'pending', 'canceled', 'error', 'completed')
|
public
|
#
deleteByService( integer $service_id )
Deletes all service changes associated with the given service
Deletes all service changes associated with the given service
Parameters
- $service_id
- The ID of the service whose changes to permanently delete
|
public
mixed
|
#
get( integer $service_change_id )
Retrieves a service change
Retrieves a service change
Parameters
- $service_change_id
- The ID of the service change to update
Returns
mixed An stdClass object representing the service change, or false otherwise
|
public
array
|
#
getAll( mixed $status = null, integer $service_id = null )
Retrieves a list of all service change entries of the given status
Retrieves a list of all service change entries of the given status
Parameters
- $status
- The status of the service changes to fetch, or null for all
- $service_id
- The ID of the service the service change belongs to (optional)
Returns
array A list of service change entries
|
public
|
#
process( integer $service_change_id )
Processes the pending service change by updating the service
Processes the pending service change by updating the service
Parameters
- $service_change_id
- The ID of the pending service change to update
|
public
boolean|Blesta\Core\Pricing\Presenter\Type\ServiceChangePresenter
|
#
getPresenter( integer $service_id, array $vars )
Retrieves a presenter representing a set of items, discounts, and taxes
for a service change (i.e. upgrade/downgrade)
Retrieves a presenter representing a set of items, discounts, and taxes
for a service change (i.e. upgrade/downgrade)
Parameters
- $service_id
- The ID of the service to change
- $vars
An array of input representing the new service changes:
- 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
- qty The service quantity
- coupon_code A new coupon code to use
- date_renews (optional) The new renew date, if it is changing from the service's current renew date
Returns
|
public
array
|
#
getStatuses( )
Retrieves a list of available service change statuses and their language
Retrieves a list of available service change statuses and their language
Returns
array A list of service change statuses and their language
|
Methods inherited from AppModel
_(),
boolToInt(),
currencyToDecimal(),
dateToUtc(),
errors(),
getPerPage(),
ifSet(),
loadCrypto(),
setDefaultIfEmpty(),
setPerPage(),
setRulesIfSet(),
strToBool(),
systemDecrypt(),
systemEncrypt(),
systemHash(),
truncateDecimal(),
validateExists(),
validateStateCountry()
|