\News
The news.
Sit back and relax, this might take a while.
History is NOT supported. Only the URLSegment is being tracked. This makes it a bit more simplistic.
- Author: Simon 'Sphere' StartGeneratedWithDataObjectAnnotator
Synopsis
class News
extends DataObject
implements
PermissionProvider
{
- // members
- private static array $db = ;
- private static array $has_one = ;
- private static array $has_many = ;
- private static array $many_many = ;
- private static array $belongs_many_many = ;
- private static array $summary_fields = ;
- private static array $searchable_fields = ;
- private static string $default_sort = 'PublishFrom DESC';
- private static array $defaults = ;
- private static array $indexes = ;
- // methods
- public string singular_name()
- public string plural_name()
- public array summaryFields()
- public array searchableFields()
- public array fieldLabels()
- public string Link()
- public void getCMSFields()
- public string AbsoluteLink()
- public bool AllowComments()
- public void onBeforeWrite()
- public void onAfterWrite()
- private void setURLValue()
- private boolean LookForExistingURLSegment()
- public string LinkingMode()
- private void setAuthorData()
- public DataList getAllowedComments()
- public Int getYearCreated()
- public string getMonthCreated()
- public string getPublished()
- public void providePermissions()
- public void canCreate()
- public void canEdit()
- public void canDelete()
- public void canView()
- public bool isPublished()
- public string getStatus()
- public void doPublish()
- public void doUnpublish()
Hierarchy
Extends
- DataObject
Implements
- PermissionProvider
Tasks
Line | Task |
---|---|
211+ | make this work on multilanguage sites. |
305 | refactor this to a facebook/twitter oAuth method that a dev spent more time on developing than I did on my Social-module. |
433+ | this needs some work and improvement |
Members
private
- $belongs_many_many
- $db
- $default_sort
- $defaults
—
array
Set defaults. Commenting (show comments if allowed in siteconfig) is default to true. - $has_many
- $has_one
- $indexes
—
array
On large databases, this is a small performance improvement. - $many_many
- $searchable_fields
- $summary_fields
Methods
private
- LookForExistingURLSegment() — test whether the URLSegment exists already on another Newsitem
- setAuthorData() — Create the author if non-existing yet, and set his/her ID to this item.
- setURLValue() — Setup the URLSegment for this item and create a Renamed Object if it's a rename-action.
public
- AbsoluteLink() — This is quite handy, for meta-tags and such.
- AllowComments() — Check if commenting on this item is allowed
- Link() — Free guess on what this button does.
- LinkingMode() — Setup the LinkingMode for menu-items.
- canCreate() — {@inheritdoc}
- canDelete() — {@inheritdoc}
- canEdit() — {@inheritdoc}
- canView() — {@inheritdoc}
- doPublish() — Publishes a news item
- doUnpublish() — Unpublishes an news item
- fieldLabels() — Setup the fieldlabels and their translation.
- getAllowedComments() — Get the allowed comments
- getCMSFields()
- getMonthCreated() — Get the month this object is published
- getPublished() — Create a date-string based on the locale. Looks better.
- getStatus() — Returns if the news item is published or not
- getYearCreated() — Get the year this object is created.
- isPublished() — Helper function to determine if this News object is already published or not
- onAfterWrite() — {@inheritdoc}
- onBeforeWrite() — The holder-page ID should be set if translatable, otherwise, we just select the first available one.
- plural_name() — Define plural name translatable
- providePermissions() — Permissions
- searchableFields() — Define translatable searchable fields
- singular_name() — Define singular name translatable
- summaryFields() — Define sumaryfields;