SilverWare\News\Pages\NewsArticle
An extension of the page class for a news article
- Author: Colin Tucker <colin@praxis.net.au>
- Copyright: 2017 Praxis Interactive
- License: https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
Synopsis
class NewsArticle
extends Page
{
- // members
- private static string $singular_name = 'News Article';
- private static string $plural_name = 'News Articles';
- private static string $description = 'An individual article within a news category';
- private static string $icon = 'silverware/news: admin/client/dist/images/icons/NewsArticle.png';
- private static string $table_name = 'SilverWare_NewsArticle';
- private static string $default_sort = '"Date" DESC';
- private static boolean $can_be_root = false;
- private static array $db = ;
- private static array $defaults = ;
- private static array $casting = ;
- private static array|string $allowed_children = 'none';
- private static array $extensions = ;
- private static string $meta_date_format = 'd MMMM Y';
- private static string $meta_image_folder = 'News';
- private static array $detail_fields = ;
- private static boolean $detail_fields_inline = true;
- private static boolean $detail_fields_hide_header = true;
- private static boolean $detail_fields_hide_names = true;
- private static array $list_item_details = ;
- // methods
- public FieldList getCMSFields()
- public array fieldLabels()
- public void populateDefaults()
- public DBDate getMetaDate()
- public NewsCategory getCategory()
- public string getCategoryLink()
- public NewsArchive getArchive()
Hierarchy
Extends
- Page
Members
private
- $allowed_children
—
SilverWare\News\Pages\array|string
Defines the allowed children for this object. - $can_be_root
—
boolean
Determines whether this object can exist at the root level. - $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_sort
—
string
Defines the default sort field and order for this object. - $defaults
—
array
Defines the default values for the fields of this object. - $description
—
string
Description of this object. - $detail_fields
—
array
Defines the detail fields to show for the object. - $detail_fields_hide_header
—
boolean
Defines the setting for hiding the detail fields header. - $detail_fields_hide_names
—
boolean
Defines the setting for hiding the detail field names. - $detail_fields_inline
—
boolean
Defines the setting for showing the detail fields inline. - $extensions
—
array
Defines the extension classes to apply to this object. - $icon
—
string
Icon file for this object. - $list_item_details
—
array
Defines the list item details to show for this object. - $meta_date_format
—
string
Defines the format for the meta date field. - $meta_image_folder
—
string
Defines the asset folder for uploaded meta images. - $plural_name
—
string
Human-readable plural name. - $singular_name
—
string
Human-readable singular name. - $table_name
—
string
Defines the table name to use for this object.
Methods
public
- fieldLabels() — Answers the labels for the fields of the receiver.
- getArchive() — Answers the parent archive of the receiver.
- getCMSFields() — Answers a list of field objects for the CMS interface.
- getCategory() — Answers the parent category of the receiver.
- getCategoryLink() — Answers a string of HTML containing a link to the parent category.
- getMetaDate() — Answers the meta date for the receiver.
- populateDefaults() — Populates the default values for the fields of the receiver.