SilverWare\Contact\Model\ContactMessage
An extension of the data object class for a contact message.
- Author: Colin Tucker <colin@praxis.net.au>
- Copyright: 2017 Praxis Interactive
- License: https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
Synopsis
class ContactMessage
extends DataObject
{
- // members
- private static string $singular_name = 'Message';
- private static string $plural_name = 'Messages';
- private static string $default_sort = '"Created" DESC';
- private static string $table_name = 'SilverWare_ContactMessage';
- private static array $db = ;
- private static array $has_one = ;
- private static array $many_many = ;
- private static array $defaults = ;
- private static array $summary_fields = ;
- protected string $HTMLTemplate = self::class;
- // methods
- public FieldList getCMSFields()
- public array fieldLabels()
- public string getTitle()
- public string getFullName()
- public string getReceived()
- public string getReceivedFrom()
- public string getRecipientNames()
- public $this addRecipients()
- public $this setParent()
- public $this setHTMLTemplate()
- public string getHTMLTemplate()
- public boolean isRead()
- public void send()
- public $this markAsRead()
- public Email toEmail()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Uses
- SilverWare\Security\CMSMainPermissions
Members
private
- $db
—
array
Maps field names to field types for this object. - $default_sort
—
string
Defines the default sort field and order for this object. - $defaults
—
array
Defines the default values for the fields of this object. - $has_one
—
array
Defines the has-one associations for this object. - $many_many
—
array
Defines the many-many associations for this object. - $plural_name
—
string
Human-readable plural name. - $singular_name
—
string
Human-readable singular name. - $summary_fields
—
array
Defines the summary fields of this object. - $table_name
—
string
Defines the table name to use for this object.
protected
- $HTMLTemplate
—
string
Defines the HTML template to use for emails.
Methods
public
- addRecipients() — Adds the given array of recipients to the receiver.
- fieldLabels() — Answers the labels for the fields of the receiver.
- getCMSFields() — Answers a list of field objects for the CMS interface.
- getFullName() — Answers the full name of the contact.
- getHTMLTemplate() — Answers the value of the HTMLTemplate attribute.
- getReceived() — Answers a nicely formatted string showing the date the message was received.
- getReceivedFrom() — Answers a string containing the name and email address of the contact.
- getRecipientNames() — Answers a string containing the recipient names of the message.
- getTitle() — Answers the title of the receiver for the CMS interface.
- isRead() — Answers true if the message is marked as read.
- markAsRead() — Marks the message as read.
- send() — Sends the message as an email to the associated recipients.
- setHTMLTemplate() — Defines the value of the HTMLTemplate attribute.
- setParent() — Defines the parent page for the receiver.
- toEmail() — Converts the message to an email object.