SilverStripe\Comments\Model\Comment
Represents a single comment object.
Synopsis
class Comment
extends DataObject
{
- // members
- private static array $db = ;
- private static array $has_one = ;
- private static array $has_many = ;
- private static string $default_sort = '"Created" DESC';
- private static array $defaults = ;
- private static array $casting = ;
- private static array $searchable_fields = ;
- private static array $summary_fields = ;
- private static array $field_labels = ;
- private static string $table_name = 'Comment';
- // methods
- public void onBeforeWrite()
- public void onBeforeDelete()
- public Comment_SecurityToken getSecurityToken()
- public string Link()
- public string Permalink()
- public array fieldLabels()
- public mixed getOption()
- public DataObject getParent()
- public string getParentTitle()
- public string getParentClassName()
- public void castingHelper()
- public string getEscapedComment()
- public boolean isPreview()
- public bool canCreate()
- public Boolean canView()
- public Boolean canEdit()
- public Boolean canDelete()
- protected Member|null getMember()
- public string getAuthorName()
- public string getAuthorEmail()
- protected string actionLink()
- public string DeleteLink()
- public string SpamLink()
- public string HamLink()
- public string ApproveLink()
- public void markSpam()
- public void markApproved()
- public void markUnapproved()
- public string SpamClass()
- public string getTitle()
- public void getCMSFields()
- public string purifyHtml()
- public HTMLPurifier getHtmlPurifierService()
- public string Gravatar()
- public boolean getRepliesEnabled()
- public boolean canPostComment()
- public SS_List AllReplies()
- public SS_List Replies()
- public PaginatedList PagedReplies()
- public Form ReplyForm()
- public string getDate()
- public void updateDepth()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Tasks
Line | Task |
---|---|
334+ | needs to compare to the new {@link Commenting} configuration API |
484 | How do we handle "DataObject" instances that don't have a Link to reject/spam/delete?? This may |
Members
private
-
$casting
{@inheritDoc} -
$db
{@inheritDoc} -
$default_sort
{@inheritDoc} -
$defaults
{@inheritDoc} -
$field_labels
{@inheritDoc} -
$has_many
{@inheritDoc} -
$has_one
{@inheritDoc} -
$searchable_fields
{@inheritDoc} -
$summary_fields
{@inheritDoc} -
$table_name
{@inheritDoc}
Methods
protected
- actionLink() — Generate a secure admin-action link authorised for the specified member
- getMember() — Resolves Member object.
public
- AllReplies() — Returns the list of all replies
- ApproveLink() — Link to approve this comment
- DeleteLink() — Link to delete this comment
- Gravatar() — Calculate the Gravatar link from the email address
- HamLink() — Link to mark as not-spam (ham)
- Link() — Return a link to this comment
- PagedReplies() — Returns the list of replies paged, with spam and unmoderated items excluded, for use in the frontend
- Permalink() — Returns the permalink for this {@link Comment}. Inserted into the ID tag of the comment
- Replies() — Returns the list of replies, with spam and unmoderated items excluded, for use in the frontend
- ReplyForm() — Generate a reply form for this comment
- SpamClass()
- SpamLink() — Link to mark as spam
- canCreate()
- canDelete() — Checks if the comment can be deleted.
- canEdit() — Checks if the comment can be edited.
- canPostComment() — Proxy for checking whether the has permission to comment on the comment parent.
- canView() — Checks for association with a page, and {@link SiteTree->ProvidePermission} flag being set to true.
- castingHelper() — {@inheritDoc}
- fieldLabels() — Translate the form field labels for the CMS administration
- getAuthorEmail() — Return the comment authors email address
- getAuthorName() — Return the authors name for the comment
- getCMSFields()
- getDate()
- getEscapedComment() — Content to be safely escaped on the frontend
- getHtmlPurifierService()
- getOption() — Get the commenting option
- getParent() — Returns the parent {@link DataObject} this comment is attached too
- getParentClassName() — Comment-parent classnames obviously vary, return the parent classname
- getParentTitle() — Returns a string to help identify the parent of the comment
- getRepliesEnabled() — Determine if replies are enabled for this instance
- getSecurityToken()
- getTitle()
- isPreview() — Return whether this comment is a preview (has not been written to the db)
- markApproved() — Mark this comment as approved
- markSpam() — Mark this comment as spam
- markUnapproved() — Mark this comment as unapproved
- onBeforeDelete() — {@inheritDoc}
- onBeforeWrite() — {@inheritDoc}
- purifyHtml()
- updateDepth() — Refresh of this comment in the hierarchy