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 ClientGroups

Client group management

Model
Extended by AppModel
Extended by ClientGroups
Package: blesta\app\models
Copyright: Copyright (c) 2010, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at app/models/client_groups.php

Methods summary

public
# __construct( )

Initialize ClientGroups

Initialize ClientGroups

Overrides

AppModel::__construct
public integer
# add( array $vars )

Add a client group using the supplied data

Add a client group using the supplied data

Parameters

$vars
array
$vars A single dimensional array of keys including: -name The name of this group -description A description of this group (optional) -company_id The company ID this group belongs to -color The HTML color that represents this group (optional)

Returns

integer
The client group ID created, or void on error
public
# edit( integer $client_group_id, array $vars )

Edit a client group using the supplied data

Edit a client group using the supplied data

Parameters

$client_group_id
integer
$client_group_id The ID of the group to be updated
$vars
array
$vars A single dimensional array of keys including: -name The name of this group -description A description of this group (optional) -company_id The company ID this group belongs to -color The HTML color that represents this group (optional)
public
# delete( integer $client_group_id )

Delete a client group and all associated client group settings

Delete a client group and all associated client group settings

Parameters

$client_group_id
integer
$client_group_id The ID for this client group
public mixed
# getDefault( integer $company_id )

Finds the default client group for the given company.

Finds the default client group for the given company.

Parameters

$company_id
integer
$company_id

Returns

mixed
stdClass object representing the default client group, false if no such group exists
public mixed
# get( integer $client_group_id )

Returns the given client group

Returns the given client group

Parameters

$client_group_id
integer
$client_group_id The ID of the client group to fetch

Returns

mixed
A stdClass object representing the client group, false if it does not exist
public mixed
# getList( integer $company_id, integer $page = 1, array $order_by = array('name'=>"ASC") )

Fetches a list of all client groups

Fetches a list of all client groups

Parameters

$company_id
integer
$company_id The company ID
$page
integer
$page The page to return results for (optional, default 1)
$order_by
string
$order_by The sort and order conditions (e.g. array('sort_field'=>"ASC"), optional)

Returns

mixed
An array of objects or false if no results.
public integer
# getListCount( mixed $company_id )

Return the total number of client groups returned from ClientGroups::getList(), useful in constructing pagination for the getList() method.

Return the total number of client groups returned from ClientGroups::getList(), useful in constructing pagination for the getList() method.

Returns

integer
The total number of clients

See

ClientGroups::getList()
public mixed
# getAll( integer $company_id )

Fetches all custom client groups by company

Fetches all custom client groups by company

Parameters

$company_id
integer
$company_id The company ID to fetch client groups for

Returns

mixed
An array of stdClass objects representing all client groups for the given company
public mixed
# getSettings( integer $client_group_id, boolean $ignore_inheritence = false )

Fetch all settings that may apply to this client group. Settings are inherited in the order of client_group_settings -> company_settings -> settings where "->" represents the left item inheriting (and overwriting in the case of duplicates) values found in the right item.

Fetch all settings that may apply to this client group. Settings are inherited in the order of client_group_settings -> company_settings -> settings where "->" represents the left item inheriting (and overwriting in the case of duplicates) values found in the right item.

Parameters

$client_group_id
integer
$client_group_id The client group ID to retrieve settings for
$ignore_inheritence
boolean
$ignore_inheritence True to fetch only client group settings without inheriting from company or system settings (default false)

Returns

mixed
An array of objects containg key/values for the settings, false if no records found
public mixed
# getSetting( integer $client_group_id, string $key )

Fetch a specific setting that may apply to this client group. Settings are inherited in the order of client_group_settings -> company_settings -> settings where "->" represents the left item inheriting (and overwriting in the case of duplicates) values found in the right item.

Fetch a specific setting that may apply to this client group. Settings are inherited in the order of client_group_settings -> company_settings -> settings where "->" represents the left item inheriting (and overwriting in the case of duplicates) values found in the right item.

Parameters

$client_group_id
integer
$client_group_id The client group ID to retrieve settings for
$key
string
$key The key name of the setting to fetch

Returns

mixed
A stdClass object containg key/values for the settings, false if no records found
public
# setSetting( integer $client_group_id, string $key, string $value, mixed $encrypted = null )

Add a client group setting, if duplicate then update the value

Add a client group setting, if duplicate then update the value

Parameters

$client_group_id
integer
$client_group_id The ID for the specified client group
$key
string
$key The key for this client group setting
$value
string
$value The value for this client group setting
$encrypted
mixed
$encrypted True to encrypt $value, false to store unencrypted, null to encrypt if currently set to encrypt
public
# unsetSetting( integer $client_group_id, string $key )

Delete a client group setting

Delete a client group setting

Parameters

$client_group_id
integer
$client_group_id The ID for the specified client group
$key
string
$key The key for this client group setting
public
# unsetSettings( integer $client_group_id )

Deletes all client group settings

Deletes all client group settings

Parameters

$client_group_id
integer
$client_group_id The ID for the specified client group
public
# setSettings( integer $client_group_id, array $vars, array $value_keys = null )

Add multiple client group settings, if duplicate then update the value

Add multiple client group settings, if duplicate then update the value

Parameters

$client_group_id
integer
$client_group_id The ID for the specified client group
$vars
array
$vars A single dimensional array of key/value pairs of settings
$value_keys
array
$value_keys An array of key values to accept as valid fields

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