SilverCart\Model\ContactMessage
A contact message object. There's a storeadmin view for this object, too.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class ContactMessage
extends DataObject
{
- // members
- private static bool $send_acknowledgement_of_receipt = true;
- private static bool $store_spam_in_database = true;
- private static integer $mark_as_spam_after_repeating = 3;
- private static array $db = ;
- private static array $has_one = ;
- private static array $has_many = ;
- private static array $casting = ;
- private static string $default_sort = 'Created DESC';
- private static string $table_name = 'SilvercartContactMessage';
- // methods
- public string singular_name()
- public string plural_name()
- public array fieldLabels()
- public array summaryFields()
- protected void onBeforeWrite()
- protected void onAfterWrite()
- public string getCreatedNice()
- public string getSalutationText()
- public bool canEdit()
- public void send()
- public string|null getField()
- public array excludeFromScaffolding()
- public FieldList getCMSFields()
- public string getTitle()
- // Inherited methods from ExtensibleDataObject
- protected void beforeRequireDefaultRecords()
- protected void beforeUpdateCMSActions()
- protected void beforeUpdateFieldLabels()
- protected void beforeUpdateProvidePermissions()
- public array defaultFieldLabels()
- public static void reset_field_labels()
- protected array scaffoldFieldLabels()
Hierarchy
Members
private
- $casting
—
array
Casting. - $db
—
array
Attributes. - $default_sort
—
string
Default SQL sort statement. - $has_many
—
array
Has-one relationships. - $has_one
—
array
Has-one relationships. - $mark_as_spam_after_repeating
—
int
Allowed number of repeating contact messages with the same content. - $send_acknowledgement_of_receipt
—
SilverCart\Model\bool
Configuration parameter to determine whether to send an acknowledgement of receipt to the customer or not. - $store_spam_in_database
—
SilverCart\Model\bool
Set this to false to delete spam detected messages. - $table_name
—
string
DB table name
protected
- $defaultFieldLabels
—
array
Default field labels.
Methods
protected
- onAfterWrite() — Deletes spam on after write if necessary.
- onBeforeWrite() — Marks spam on before write if necessary.
public
- canEdit() — Disable editing for all Member types.
- excludeFromScaffolding() — Returns an array of field/relation names (db, has_one, has_many, many_many, belongs_many_many) to exclude from form scaffolding in backend.
- fieldLabels() — Field labels for display in tables.
- getCMSFields() — customizes the backends fields, mainly for ModelAdmin
- getCreatedNice() — returns the orders creation date formated: dd.mm.yyyy hh:mm
- getField() — returns field value for given fieldname with stripped slashes
- getSalutationText() — Returns the localized salutation string.
- getTitle() — Returns the title.
- plural_name() — Returns the translated plural name.
- send() — Send the contact message via email.
- singular_name() — Returns the translated singular name.
- summaryFields() — Summaryfields for display in tables.
Inherited from SilverCart\ORM\ExtensibleDataObject
protected
- beforeRequireDefaultRecords() — Allows user code to hook into DataObject::requireDefaultRecords() prior to requireDefaultRecords being called on extensions.
- beforeUpdateCMSActions() — Allows user code to hook into DataObject::getCMSActions prior to updateCMSActions being called on extensions.
- beforeUpdateFieldLabels() — Allows user code to hook into DataObject::fieldLabels() prior to updateFieldLabels being called on extensions.
- beforeUpdateProvidePermissions() — Allows user code to hook into DataObject::updateProvidePermissions() prior to providePermissions being called on extensions.
- scaffoldFieldLabels() — Returns the default field labels for this DataObject.
public
- defaultFieldLabels() — Returns the default field labels.
- reset_field_labels() — Resets the field label cache.