Overview

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • auth
        • ldap
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
      • exchange
        • rates
          • currency
            • layer
          • fixer
          • open
            • exchange
              • rates
          • x
            • rates
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • perforated
            • invoice
          • quickbooks
            • invoice
          • templates
            • default
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • reports
        • aging
          • invoices
        • client
          • data
            • portability
        • custom
          • report
        • invoice
          • creation
        • package
          • revenue
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • core
      • Automation
        • Tasks
          • Common
          • Task
        • Type
          • Common
          • Cron
      • Pricing
        • ItemComparator
        • MetaItem
        • Modifier
          • Type
            • Description
              • Type
                • Discount
                • Option
                • Service
                • Tax
            • Discount
            • Price
            • Proration
        • Presenter
          • Build
            • Invoice
            • InvoiceData
            • Options
            • Service
            • ServiceChange
            • ServiceData
          • Collection
          • Format
            • Fields
            • Type
              • Discount
              • Item
              • Option
              • Options
              • Package
              • Pricing
              • Service
              • Tax
          • Items
            • Invoice
            • Service
          • Type
      • ServiceProviders
      • Util
        • Captcha
          • Captchas
          • Common
        • Common
          • Traits
        • Events
          • Common
          • Handlers
          • Observers
        • Filters
          • Common
        • GeoIp
        • Input
          • Fields
            • Common
        • Tax
        • Widgets
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • helpers
      • color
      • data
        • structure
  • None
  • PHP

Classes

  • Accounts
  • Actions
  • ApiKeys
  • Backup
  • CalendarEvents
  • ClientGroups
  • Clients
  • Companies
  • Contacts
  • Countries
  • Coupons
  • CouponTerms
  • CronTasks
  • Currencies
  • EmailGroups
  • Emails
  • EmailVerifications
  • Encryption
  • GatewayManager
  • Invoices
  • InvoiceTemplateManager
  • Languages
  • Logs
  • Marketplace
  • MessageGroups
  • Messages
  • MessengerManager
  • ModuleClientMeta
  • ModuleManager
  • ModuleTypes
  • Navigation
  • PackageGroups
  • PackageOptionGroups
  • PackageOptions
  • Packages
  • Payments
  • Permissions
  • PluginManager
  • Pricings
  • ReportManager
  • ServiceChanges
  • ServiceInvoices
  • Services
  • Settings
  • Staff
  • StaffGroups
  • States
  • SystemEvents
  • Taxes
  • Themes
  • Transactions
  • Users
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Class ServiceChanges

Service upgrades/downgrades

Model
Extended by AppModel uses Blesta\Core\Util\Common\Traits\Container
Extended by ServiceChanges
Package: blesta\app\models
Copyright: Copyright (c) 2015, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at app/models/service_changes.php
Methods summary
public
# __construct( )

Initialize language

Initialize language

Overrides

AppModel::__construct()
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

boolean|Blesta\Core\Pricing\Presenter\Type\ServiceChangePresenter
The presenter, otherwise false
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()
Methods used from Blesta\Core\Util\Common\Traits\Container
getFromContainer()
Properties inherited from AppModel
$logger, $replacement_keys
Blesta API documentation generated by ApiGen