BlogObject
trait BlogObject (View source)
An object shared by BlogTag and BlogCategory.
Methods
Looks for objects o the same type and the same value by the given Field
Returns an error message for this object when it tries to write a duplicate.
Details
BlogPost>
BlogPosts(int|array|null $id = null)
No description
getCMSFields()
{@inheritdoc}
ValidationResult
validate()
{@inheritdoc}
string
getLink()
Returns a relative link to this category.
bool
canView(null|Member $member = null)
Inherits from the parent blog or can be overwritten using a DataExtension.
canCreate($member = null, $context = [])
{@inheritdoc}
bool
canDelete(null|Member $member = null)
Inherits from the parent blog or can be overwritten using a DataExtension.
bool
canEdit(null|Member $member = null)
Inherits from the parent blog or can be overwritten using a DataExtension.
protected
onBeforeWrite()
{@inheritdoc}
string
generateURLSegment(int $increment = 0)
Generates a unique URLSegment from the title.
protected DataList
getDuplicatesByField(string $field)
Looks for objects o the same type and the same value by the given Field
abstract protected string
getListUrlSegment()
This returns the url segment for the listing page.
eg. 'categories' in /my-blog/categories/category-url
This is not editable at the moment, but a method is being used incase we want to make it editable in the future. We can use this method to provide logic without replacing multiple areas of the code base. We're also not being opinionated about how the segment should be obtained at the moment and allowing for the implementation to decide.
abstract protected string
getDuplicateError()
Returns an error message for this object when it tries to write a duplicate.