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 StaffGroups

Staff group management

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

Initialize Staff Groups

Initialize Staff Groups

Overrides

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

Adds a new staff group

Adds a new staff group

Parameters

$vars

An array of staff group information including:

  • company_id The company ID
  • name The name of this staff group
  • session_lock Set whether or not the IP set for the session must match the user's IP
  • notices An array of email group actions representing BCC notices available to this group
  • permission_group A numerically indexed array of permission group IDs to allow access to
  • permission A numerically indexed array of permission field IDs to allow access to

Returns

integer
The staff group ID created, void on error

See

Permissions::getAll()
public integer
# edit( integer $staff_group_id, array $vars )

Updates a staff group

Updates a staff group

Parameters

$staff_group_id
The staff group ID
$vars

An array of staff group information including:

  • company_id The company ID
  • name The name of this staff group
  • session_lock Set whether or not the IP set for the session must match the user's IP
  • notices An array of email group actions representing BCC notices available to this group
  • permission_group A numerically indexed array of permission group IDs to allow access to
  • permission A numerically indexed array of permission field IDs to allow access to

Returns

integer
The staff group ID created, void on error

See

Permissions::getAll()
public
# delete( integer $staff_group_id )

Deletes a staff group

Deletes a staff group

Parameters

$staff_group_id
The staff group ID
public
# grantPermission( integer $staff_group_id, integer $plugin_id )

Grant access to every permission allowed by the given plugin to the given staff group

Grant access to every permission allowed by the given plugin to the given staff group

Parameters

$staff_group_id
The staff group ID to grant access for
$plugin_id
The ID of the plugin to grant access to
public integer
# cloneGroup( integer $staff_group_id, integer $company_id )

Clone an existing staff group to the given company

Clone an existing staff group to the given company

Parameters

$staff_group_id
The ID of the staff group to clone
$company_id
The ID of the company to assign the cloned staff group to

Returns

integer
The ID of the new staff group
public
# addNotice( array $vars )

Adds a staff group notice

Adds a staff group notice

Parameters

$vars

An array of staff group information including:

  • staff_group_id The ID of the staff group this notice will be added to
  • action The email group action
public
# deleteNotice( integer $staff_group_id, string $action = null )

Deletes the given staff group notice

Deletes the given staff group notice

Parameters

$staff_group_id
The ID of the staff group the notice belongs to
$action
The email group action to remove (optional, default null to delete all notices)
public mixed
# get( integer $staff_group_id )

Fetches a staff group

Fetches a staff group

Parameters

$staff_group_id
The staff group ID to fetch

Returns

mixed
An array of stdClass objects representing the staff group, false if it does not exist
public mixed
# getAll( integer $company_id = null )

Fetches all staff groups belonging to a given company, or all companies if not given

Fetches all staff groups belonging to a given company, or all companies if not given

Parameters

$company_id
The ID of the company whose staff groups to fetch (optional, default null)

Returns

mixed
An array of stdClass objects representing the staff groups of a company, or false if none exist
public array
# getUsersGroups( integer $user_id )

Fetch all groups and companies this staff user is associated with

Fetch all groups and companies this staff user is associated with

Parameters

$user_id
The ID of the user to fetch staff group info for

Returns

array
An array of stdClass objects representing a particular staff group/staff member association
public stdClass
# getStaffGroupByStaff( integer $staff_id, integer $company_id )

Fetches the staff group for the given staff member and company

Fetches the staff group for the given staff member and company

Parameters

$staff_id
The ID of the staff member to fetch the group for
$company_id
The ID of the company to fetch the staff group for

Returns

stdClass
A stdClass representation of the staff group
public mixed
# getList( integer $company_id, integer $page = 1, string $order_by = ['name' => 'ASC'] )

Retrieves a list of plugins installed under a particular company

Retrieves a list of plugins installed under a particular company

Parameters

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

Returns

mixed
An array of stdClass objects representing staff groups, or false if none exist
public integer
# getListCount( integer $company_id )

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

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

Parameters

$company_id
The company ID

Returns

integer
The total number of staff groups

See

StaffGroups::getList()
public array
# getNotices( integer $staff_group_id )

Fetches all staff group notices

Fetches all staff group notices

Parameters

$staff_group_id
The ID of the staff group

Returns

array
A list of all staff group notices
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