Axllent\Weblog\Model\BlogPost
Synopsis
class BlogPost
extends Page
{
- // members
- private static string $table_name = 'BlogPost';
- private static boolean $can_be_root = false;
- private static string $default_parent = 'Blog';
- private static string $icon = 'axllent/silverstripe-weblog: icons/BlogPost.png';
- private static string $featured_image_folder = 'Blog';
- private static boolean $show_in_sitetree = false;
- private static array $db = ;
- private static array $casting = ;
- private static array $summary_fields = ;
- private static array $has_one = ;
- private static array $owns = ;
- private static array $defaults = ;
- private static string $default_sort = '"PublishDate" IS NULL DESC, "PublishDate" DESC';
- private static array $allowed_children = ;
- // methods
- public void getCMSFields()
- public string|null getDate()
- public void previousBlogPost()
- public void nextBlogPost()
- public void onBeforeWrite()
- public void onBeforePublish()
- public void canEdit()
- public void canView()
- public void canCreate()
- public void canDelete()
- public void canPublish()
Hierarchy
Extends
- Page
Members
private
- $allowed_children — array
- $can_be_root
- $casting
- $db
- $default_parent
-
$default_sort
The default sorting lists BlogPosts with an empty PublishDate at the top. - $defaults
- $featured_image_folder
- $has_one
- $icon
- $owns
- $show_in_sitetree
- $summary_fields
- $table_name
Methods
public
- canCreate()
- canDelete()
- canEdit()
- canPublish()
- canView()
- getCMSFields()
- getDate() — Display the publish date in rss feeds.
- nextBlogPost()
- onBeforePublish() — Update the PublishDate to now if the BlogPost would otherwise be published without a date.
- onBeforeWrite() — Ensure the Parent is a Blog, if not move it to the first blog
- previousBlogPost()