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 PackageOptionGroups

Package Option Group management

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

Initialize PackageOptionGroups

Initialize PackageOptionGroups

Overrides

AppModel::__construct()
public mixed
# get( integer $option_group_id )

Fetches the package option group

Fetches the package option group

Parameters

$option_group_id
The ID of the package option group to fetch

Returns

mixed
A stdClass object representing the package option group, false if no such group exists
public array
# getAll( integer $company_id )

Fetches all package option groups for a given company

Fetches all package option groups for a given company

Parameters

$company_id
The company ID

Returns

array
An array of stdClass objects representing each package option group
public array
# getAllPackageIds( integer $option_group_id )

Fetches the package IDs of all packages assigned to this package option group

Fetches the package IDs of all packages assigned to this package option group

Parameters

$option_group_id
The ID of the package option group whose assigned packages to fetch

Returns

array
An array of stdClass objects representing
public array
# getAllOptions( integer $option_group_id )

Fetches all package options assigned to this package option group

Fetches all package options assigned to this package option group

Parameters

$option_group_id
The ID of the package option group whose package options to fetch

Returns

array
An array of stdClass objects representing each package option group
public array
# getList( integer $company_id, integer $page = 1, array $order_by = ['name' => 'asc'] )

Fetches a list of all package option groups for a given company

Fetches a list of all package option groups for a given company

Parameters

$company_id
The company ID to fetch package option groups for
$page
The page to return results for
$order_by
The sort and order conditions (e.g. array('sort_field'=>"ASC"), optional)

Returns

array
An array of objects, each representing a package option group
public integer
# getListCount( integer $company_id )

Returns the total number of package option groups returned from PackageOptionGroups::getList(), useful in constructing pagination for the getList() method.

Returns the total number of package option groups returned from PackageOptionGroups::getList(), useful in constructing pagination for the getList() method.

Parameters

$company_id
The company ID to fetch package option groups for

Returns

integer
The total number of package option groups

See

PackageOptionGroups::getList()
public integer
# add( array $vars )

Adds a package option group for the given company

Adds a package option group for the given company

Parameters

$vars

An array of package option group info including:

  • company_id The ID for the company under which to add the package option group
  • name The package option group name
  • description The description of the group
  • packages A list of package IDs to assign to this option group (optional)

Returns

integer
The package option group ID, void on error
public integer
# edit( integer $option_group_id, array $vars )

Updates a package option group

Updates a package option group

Parameters

$option_group_id
The ID of the package option group to update
$vars

An array of package option group info including:

  • name The package option group name
  • description The description of the group
  • packages A list of package IDs to assign to this option group (optional)

Returns

integer
The package option group ID, void on error
public
# delete( integer $option_group_id )

Permanently removes a package option group from the system

Permanently removes a package option group from the system

Parameters

$option_group_id
The package option group ID to delete
public
# orderOptions( integer $option_group_id, array $option_ids )

Save the package options for the given group in the provided order

Save the package options for the given group in the provided order

Parameters

$option_group_id
The ID of the group to order options for
$option_ids
A numerically indexed array of option IDs
public boolean
# validatePackage( integer $package_id, integer $company_id = null, integer $option_group_id = null )

Validates that the given group is valid

Validates that the given group is valid

Parameters

$package_id
The ID of the package to validate
$company_id

The ID of the company the package should belong to (optional, required if $option_group_id not given, default null)

$option_group_id

The ID of the option group that the package is to be assigned to (optional, required if $company_id not given, default null)

Returns

boolean
True if the package option group is valid, or false otherwise
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