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 Messages

Messages

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

Initialize Messages

Initialize Messages

Overrides

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

Adds a new message

Adds a new message

Parameters

$vars

An array of message info including:

  • message_group_id The message group ID where the message belongs
  • company_id The company ID
  • type The message type (optional, "sms" by default)
  • status The message status (optional, "active" by default)
  • content A numerically indexed array each containing the message content for each language on the system
    • lang The language of the message content
    • content The message content

Returns

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

Edits an existing message

Edits an existing message

Parameters

$message_id
The message ID to update
$vars

An array of message info including:

  • message_group_id The message group ID where the message belongs
  • type The message type (optional, "sms" by default)
  • status The message status (optional, "active" by default)
  • content A numerically indexed array each containing the message content for each language on the system
    • lang The language of the message content
    • content The message content

Returns

integer
The ID for this message, void on error
public
# delete( integer $message_id )

Deletes an existing message

Deletes an existing message

Parameters

$message_id
The message ID to delete
public mixed
# get( integer $message_id )

Fetches an existing message

Fetches an existing message

Parameters

$message_id
The ID of the message to fetch

Returns

mixed
A stdClass object representing the message if it exists, false otherwise
public mixed
# getAll( integer $company_id = null, array $filters = [] )

Fetches a full list of all messages for a given company

Fetches a full list of all messages for a given company

Parameters

$company_id
The ID of the company to fetch messages for
$filters

A list of parameters to filter by, including:

  • plugin_dir The directory name of the plugin to fetch message groups for

Returns

mixed
An array of stdClass objects representing all messages, or false if no messages found
public stdClass
# getByGroup( string $message_group_id, string $lang = null, integer $company_id = null )

Fetches a messages for a given message group and language

Fetches a messages for a given message group and language

Parameters

$message_group_id
The ID of the message group
$lang

The language in ISO 636-1 2-char + "_" + ISO 3166-1 2-char (e.g. en_us) (optional)

$company_id
The ID of the company to fetch messages for (optional)

Returns

stdClass

An stdClass object representing the message group with their messages, or false if no messages found

public array
# getTypes( )

Returns a list of the supported message types

Returns a list of the supported message types

Returns

array
A list of the supported message types
public array
# getStatusTypes( )

Retrieves a list of message status types

Retrieves a list of message status types

Returns

array
Key=>value pairs of email status types
public array
# getMessageContent( integer $message_id, string $lang = null )

Gets the content from an specific message

Gets the content from an specific message

Parameters

$message_id
The message ID to fetch the message content
$lang

The language in ISO 636-1 2-char + "_" + ISO 3166-1 2-char (e.g. en_us) (optional)

Returns

array
An array of stdClass objects, containing each the message content
public
# setMessageContent( integer $message_id, array $vars )

Sets the message content of an existing message

Sets the message content of an existing message

Parameters

$message_id
The message ID where the message content belongs
$vars

A numerically indexed array each containing the message content for each language on the system - lang The language of the message content - content The message content

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