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 Actions

Actions

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

Initialize Messages

Initialize Messages

Overrides

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

Adds a new action

Adds a new action

Parameters

$vars

An array of action info including:

  • location The identifier for the location to display the action (optional, "nav_staff" by default) ('nav_client', 'nav_staff', 'nav_public', 'widget_client_home', 'widget_staff_home', 'widget_staff_client', 'widget_staff_billing', 'action_staff_client')
  • url The full or partial URL of the action
  • name The language identifier or text with which to label the action
  • options A list of additional options for the action
  • plugin_id The ID of the plugin with which this action is associated (optional, null by default)
  • company_id The ID of the company to which this action belongs
  • editable Whether the action can be updated through the interface (0 or 1) (optional, 1 by default)
  • enabled Whether the action can be used in the interface (0 or 1) (optional, 1 by default)

Returns

integer
The ID for this action, void on error
public integer
# edit( integer $action_id, array $vars )

Edits an existing action

Edits an existing action

Parameters

$action_id
The action ID to update
$vars

An array of action info including:

  • name The the text or language identifier with which to label the action
  • url The URL of the action
  • options A list of additional options for the action
  • enabled Whether the action can be used in the interface (0 or 1)

Returns

integer
The ID for this action, void on error
public array
# mapOldFields( array $vars )

Map the pre Blesta v5 fields to their new equivilent

Map the pre Blesta v5 fields to their new equivilent

Parameters

$vars
A list of input vars to map

Returns

array
The converted list of input vars
public
# delete( integer $plugin_id, string $url = null )

Deletes an existing action

Deletes an existing action

Parameters

$plugin_id
The ID of the plugin from which to remove the action
$url

The URL of the specific record to delete, otherwise defaults to delete all records for this action (optional)

public mixed
# get( integer $action_id, boolean $translate = true )

Fetches an existing action

Fetches an existing action

Parameters

$action_id
The ID of the action to fetch
$translate
Whether or not to translate any language definitions (optional, default true)

Returns

mixed
A stdClass object representing the action if it exists, false otherwise
public mixed
# getByUrl( string $url, string $location = null, integer $company_id = null, boolean $translate = true )

Fetches an existing action by URL

Fetches an existing action by URL

Parameters

$url
The URL of the action to fetch
$location

The location identifier by which to get actions (optional) ('nav_client', 'nav_staff', 'nav_public', 'widget_client_home', 'widget_staff_home', 'widget_staff_client', 'widget_staff_billing', 'action_staff_client')

$company_id
The ID of the company for which to fetch actions (optional)
$translate
Whether or not to translate any language definitions (optional, default true)

Returns

mixed
A stdClass object representing the action if it exists, false otherwise
public array
# getAll( array $filters = [], boolean $translate = true )

Fetches a full list of all actions

Fetches a full list of all actions

Parameters

$filters

A list of parameters to filter by, including:

  • location The location identifier by which to get actions ('nav_client', 'nav_staff', 'nav_public', 'widget_client_home', 'widget_staff_home', 'widget_staff_client', 'widget_staff_billing', 'action_staff_client')
  • plugin_id The ID of the plugin for which to fetch actions
  • company_id The ID of the company for which to fetch actions
  • enabled Whether to fetch only enabled actions
  • editable Whether to fetch only aditable actions
$translate
Whether or not to translate any language definitions (optional, default true)

Returns

array
An array of stdClass objects representing all actions
public array
# getList( array $filters = [], integer $page = 1, array $order_by = ['id' => 'DESC'], boolean $translate = true )

Fetches a paginated list of actions

Fetches a paginated list of actions

Parameters

$filters

A list of parameters to filter by, including:

  • location The location identifier by which to get actions ('nav_client', 'nav_staff', 'nav_public', 'widget_client_home', 'widget_staff_home', 'widget_staff_client', 'widget_staff_billing', 'action_staff_client')
  • plugin_id The ID of the plugin for which to fetch actions
  • company_id The ID of the plugin for which to fetch actions
  • enabled Whether to fetch only enabled actions
  • editable Whether to fetch only aditable actions
$page
The page to return results for (optional, default 1)
$order_by
The sort and order conditions (e.g. array('sort_field'=>"ASC"), optional)
$translate
Whether or not to translate any language definitions (optional, default true)

Returns

array
An array of stdClass objects representing all actions
public integer
# getListCount( array $filters )

Return the total number of actions returned from Action::getList(), useful in constructing pagination for the getList() method.

Return the total number of actions returned from Action::getList(), useful in constructing pagination for the getList() method.

Parameters

$filters

A list of parameters to filter by, including:

  • location The location identifier by which to get actions ('nav_client', 'nav_staff', 'nav_public', 'widget_client_home', 'widget_staff_home', 'widget_staff_client', 'widget_staff_billing', 'action_staff_client')
  • plugin_id The ID of the plugin for which to fetch actions
  • company_id The ID of the plugin for which to fetch actions
  • editable Whether to fetch only aditable actions
  • enabled Whether to fetch only enabled actions

Returns

integer
The total number of actions

See

Actions::getList()
public array
# getLocations( )

Retrieves a list of action locations

Retrieves a list of action locations

Returns

array
Key=>value pairs of action locations
public array
# getLocationDescriptions( )

Retrieves a list of action locations and their descriptions

Retrieves a list of action locations and their descriptions

Returns

array
Key=>value pairs of action locations and their descriptions
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