Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • components
        • events
          • default
      • controllers
      • models
    • components
      • auth
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • exchange
        • rates
          • foxrate
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
      • json
      • modules
      • net
        • http
        • net
          • amazon
            • s3
          • geo
            • ip
      • plugins
      • recaptcha
      • security
      • session
        • cart
      • settingscollection
      • upgrades
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
  • com
    • tecnick
      • tcpdf
        • blesta
          • components
            • invoice
              • templates
                • quickbooks
                  • invoice
                • templates
                  • default
  • Crypt
    • AES
    • DES
    • Hash
    • Random
    • RC4
    • Rijndael
    • RSA
    • TerraDES
  • File
    • ANSI
    • ASN1
    • X509
  • Math
    • BigInteger
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • html
      • xml
    • lib
  • Net
    • SFTP
    • SSH1
    • SSH2
  • None
  • PHP
  • PHPMailer
  • Services
    • JSON
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

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

Class StaffGroups

Staff group management

Model
Extended by AppModel
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
array
$vars An array of staff group information including: - company_id The company ID - name The name of this staff group - notices An array of email group actions representing BCC notices available to this group

Returns

integer
The staff group ID created, void on error
public integer
# edit( integer $staff_group_id, array $vars )

Updates a staff group

Updates a staff group

Parameters

$staff_group_id
integer
$staff_group_id The staff group ID
$vars
array
$vars An array of staff group information including: - company_id The company ID - name The name of this staff group - notices An array of email group actions representing BCC notices available to this group

Returns

integer
The staff group ID created, void on error
public
# delete( integer $staff_group_id )

Deletes a staff group

Deletes a staff group

Parameters

$staff_group_id
integer
$staff_group_id The staff group ID
public
# addNotice( array $vars )

Adds a staff group notice

Adds a staff group notice

Parameters

$vars
array
$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
integer
$staff_group_id The ID of the staff group the notice belongs to
$action
string
$action The email group action to remove (optional, default null to delete all notices)
private
# deleteGroupNotices( integer $staff_group_id, string $action = null )

Deletes the staff group notices

Deletes the staff group notices

Parameters

$staff_group_id
integer
$staff_group_id The ID of the staff group
$action
string
$action The email group action (optional)
public mixed
# get( integer $staff_group_id )

Fetches a staff group

Fetches a staff group

Parameters

$staff_group_id
integer
$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
integer
$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
integer
$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
integer
$staff_id The ID of the staff member to fetch the group for
$company_id
integer
$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 = array('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
integer
$company_id The company ID
$page
integer
$page The page of results to fetch (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 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
integer
$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
integer
$staff_group_id The ID of the staff group

Returns

array
A list of all staff group notices
private Record
# getGroups( integer $company_id = null )

Partially constructs the query required by StaffGroups::getList(), StaffGroups::getListCount(), and StaffGroups::getAll()

Partially constructs the query required by StaffGroups::getList(), StaffGroups::getListCount(), and StaffGroups::getAll()

Parameters

$company_id
integer
$company_id The company ID (optional, default null)

Returns

Record
The partially constructed query Record object
private
# setPermissions( string $aro, array $vars, integer $company_id )

Removes any existing entries in the ACL for this ACO and adds "allow" entires for all of the given permission groups and permission fields.

Removes any existing entries in the ACL for this ACO and adds "allow" entires for all of the given permission groups and permission fields.

Parameters

$aro
string
$aco The ACO to set "allow" access permissions in the ACL
$vars
array
$vars An array containing the following: - 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
$company_id
integer
$company_id The ID of the company to set permissions under

See

StaffGroups::add()
StaffGroups::edit()
private array
# getRules( )

Fetches the rules for adding/editing a staff group

Fetches the rules for adding/editing a staff group

Returns

array
The staff group rules
private array
# getNoticeRules( array $vars )

Fetches the rules for adding/editing a staff group notice

Fetches the rules for adding/editing a staff group notice

Parameters

$vars
array
$vars A list of input vars

Returns

array
The staff group notice rules

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