Methods summary
public
|
#
__construct( )
Initialize Messages
Overrides
|
public
integer
|
#
add( array $vars )
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
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
|
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
|