Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • areyouahuman
      • auth
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
        • default
      • exchange
        • rates
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • quickbooks
            • invoice
      • json
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • recaptcha
      • reports
        • aging
          • invoices
        • custom
          • report
        • invoice
          • creation
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • form
      • html
      • javascript
      • xml
    • lib
  • None
  • PHP

Classes

  • Accounts
  • ApiKeys
  • CalendarEvents
  • ClientGroups
  • Clients
  • Companies
  • Contacts
  • Countries
  • Coupons
  • CronTasks
  • Currencies
  • EmailGroups
  • Emails
  • Encryption
  • GatewayManager
  • Invoices
  • InvoiceTemplateManager
  • Languages
  • Logs
  • Marketplace
  • ModuleClientMeta
  • ModuleManager
  • Navigation
  • PackageGroups
  • PackageOptionGroups
  • PackageOptions
  • Packages
  • Payments
  • Permissions
  • PluginManager
  • Pricings
  • ReportManager
  • ServiceChanges
  • Services
  • Settings
  • Staff
  • StaffGroups
  • States
  • Taxes
  • Themes
  • Transactions
  • Users

Class PackageOptionGroups

Package Option Group management

Model
Extended by AppModel
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
integer
$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
integer
$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
integer
$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
integer
$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 = array('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
integer
$company_id The company ID to fetch package option groups for
$page
integer
$page The page to return results for
$order_by
array
$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
integer
$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
array
$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( array $option_group_id, array $vars )

Updates a package option group

Updates a package option group

Parameters

$option_group_id
array
$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)
$vars

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
integer
$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
integer
$option_group_id The ID of the group to order options for
$option_ids
array
$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
integer
$package_id The ID of the package to validate
$company_id
integer
$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
integer
$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 inherited from Model

affectedRows(), begin(), commit(), getConnection(), lastInsertId(), makeDSN(), prepare(), query(), rollBack(), setAttribute(), setFetchMode()

Magic methods summary

Properties summary

Properties inherited from AppModel

$replacement_keys

Blesta API documentation generated by ApiGen 2.8.0