Class MessageGroups
-
Model
-
AppModel
uses
Blesta\Core\Util\Common\Traits\Container
-
MessageGroups
Methods summary
public
|
#
__construct( )
Initialize MessageGroups
Overrides
|
public
integer
|
#
add( array $vars )
Adds a message group
Parameters
- $vars
An array of message info including:
- action The message group action
- type The message group type (optional)
- plugin_dir The directory name of the plugin where the message group belongs
- tags Tags that apply to this group (optional, default null)
Returns
integer The ID for this message group
|
public
|
#
edit( integer $message_group_id, array $vars )
Edits an existing message group
Edits an existing message group
Parameters
- $message_group_id
- The ID of the message group to update
- $vars
An array of message info including:
- action The message group action
- type The message group type (optional)
- plugin_dir The directory name of the plugin where the message group belongs
- tags Tags that apply to this group (optional, default null)
|
public
|
#
delete( integer $message_group_id )
Deletes an existing message group
Deletes an existing message group
Parameters
- $message_group_id
- The message group ID to delete
|
public
mixed
|
#
get( integer $message_group_id )
Fetches an existing message
Fetches an existing message
Parameters
- $message_group_id
- The ID of the message group to fetch
Returns
mixed A stdClass object representing the message group if it exists, false otherwise
|
public
array
|
#
getAll( array $filters = [] )
Fetches a full list of all message groups
Fetches a full list of all message groups
Parameters
- $filters
A list of parameters to filter by, including:
- plugin_dir The directory name of the plugin to fetch message groups for
Returns
array A list of stdClass objects representing all message groups
|
public
array
|
#
getAllMessages( integer $company_id, string $type = 'client', boolean $core = true, string $lang = null )
Fetches a list of all messages and message groups under a company for a specific type and language
Fetches a list of all messages and message groups under a company for a specific type and language
Parameters
- $company_id
- The company ID to fetch message groups for
- $type
The type of message group to get, "client", "staff", "shared"
or null to fetch all types (optional, default "client")
- $core
True to fetch all core message groups, or false to
fetch all plugin-related message groups (optional, default true)
- $lang
The language in ISO 636-1 2-char + "_"
+ ISO 3166-1 2-char (e.g. en_us) (optional, defaults to default language)
Returns
array A list of stdClass objects representing the messages
|
public
mixed
|
#
getByAction( string $action )
Fetches a message group
Parameters
- $action
- The action of message group to fetch
Returns
mixed An stdClass object representing the message group, or false if one does not exist
|
public
array
|
#
getTypes( )
Returns a list of the supported message group types
Returns a list of the supported message group types
Returns
array A list of the supported message group types
|
Methods inherited from AppModel
_(),
boolToInt(),
currencyToDecimal(),
dateToUtc(),
errors(),
getPerPage(),
ifSet(),
loadCrypto(),
setDefaultIfEmpty(),
setPerPage(),
setRulesIfSet(),
strToBool(),
systemDecrypt(),
systemEncrypt(),
systemHash(),
truncateDecimal(),
validateExists(),
validateStateCountry()
|