SilverWare\Testimonials\Model\Testimonial
An extension of the data object class for a testimonial.
- Author: Colin Tucker <colin@praxis.net.au>
- Copyright: 2017 Praxis Interactive
- License: https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
Synopsis
class Testimonial
extends DataObject
{
- // constants
- const TITLE_MODE_AUTHOR = 'author';
- const TITLE_MODE_AUTHOR_POS = 'author-position';
- const TITLE_MODE_AUTHOR_ORG = 'author-organisation';
- // members
- private static string $singular_name = 'Testimonial';
- private static string $plural_name = 'Testimonials';
- private static string $default_sort = 'Sort';
- private static string $table_name = 'SilverWare_Testimonial';
- private static array $db = ;
- private static array $has_one = ;
- private static array $defaults = ;
- private static array $casting = ;
- private static array $summary_fields = ;
- private static array $extensions = ;
- private static string $default_date_format = 'd MMMM Y';
- private static array $meta_fields = ;
- private static string $meta_image_folder = 'Testimonials';
- // methods
- public FieldList getCMSFields()
- public RequiredFields getCMSValidator()
- public array fieldLabels()
- public void onBeforeWrite()
- public void populateDefaults()
- public DBDate getMetaDate()
- public string getMetaLink()
- public string getMetaImageCaption()
- public string getTitle()
- public string getMetaTitle()
- public string getAuthorAndPosition()
- public string getAuthorAndOrganisation()
- public TestimonialPage getParent()
- public string getDateFormat()
- public string getDateFormatted()
- public boolean getDateShown()
- public boolean getPositionShown()
- public boolean getOrganisationShown()
- public AssetContainer|DBHTMLText getStripThumbnail()
- public array getImageClassNames()
- public integer getImageMetaResizeWidth()
- public integer getImageMetaResizeHeight()
- public integer getImageMetaResizeMethod()
- public DBHTMLText|string getContentOrSummary()
- public array getTitleModeOptions()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Uses
- SilverWare\View\Renderable
- SilverWare\View\ViewClasses
- SilverWare\Security\CMSMainPermissions
Constants
Name | Value |
---|---|
TITLE_MODE_AUTHOR | 'author' |
TITLE_MODE_AUTHOR_POS | 'author-position' |
TITLE_MODE_AUTHOR_ORG | 'author-organisation' |
Members
private
- $casting
—
array
Maps field and method names to the class names of casting objects. - $db
—
array
Maps field names to field types for this object. - $default_date_format
—
string
Defines the default date format to use for the template. - $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. - $extensions
—
array
Defines the extension classes to apply to this object. - $has_one
—
array
Defines the has-one associations for this object. - $meta_fields
—
array
Defines the meta field configuration for this object. - $meta_image_folder
—
string
Defines the asset folder for uploading images. - $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.
Methods
public
- fieldLabels() — Answers the labels for the fields of the receiver.
- getAuthorAndOrganisation() — Answers a string with the author name and organisation (if available).
- getAuthorAndPosition() — Answers a string with the author name and position (if available).
- getCMSFields() — Answers a list of field objects for the CMS interface.
- getCMSValidator() — Answers a validator for the CMS interface.
- getContentOrSummary() — Answers either the content of the testimonial or the summary (if no content is defined).
- getDateFormat() — Answers the date format for the receiver.
- getDateFormatted() — Answers the date of the receiver as a formatted string.
- getDateShown() — Answers true if the date is to be shown in the template.
- getImageClassNames() — Answers an array of image class names for the template.
- getImageMetaResizeHeight() — Answers the resize height for the meta image.
- getImageMetaResizeMethod() — Answers the resize method for the meta image.
- getImageMetaResizeWidth() — Answers the resize width for the meta image.
- getMetaDate() — Answers the meta date for the testimonial.
- getMetaImageCaption() — Answers the meta image caption for the testimonial.
- getMetaLink() — Answers the meta link for the testimonial.
- getMetaTitle() — Answers the meta title for the receiver.
- getOrganisationShown() — Answers true if the organisation is to be shown in the template.
- getParent() — Answers the parent page of the testimonial.
- getPositionShown() — Answers true if the position is to be shown in the template.
- getStripThumbnail() — Answers a thumbnail of the image for a grid field.
- getTitle() — Answers the title of the receiver for the CMS interface.
- getTitleModeOptions() — Answers an array of options for the title mode field.
- onBeforeWrite() — Event method called before the extended object is written to the database.
- populateDefaults() — Populates the default values for the fields of the receiver.