News
class News extends UrlModel implements NamedModel
A news article
Constants
TABLE |
The name of the database table used for queries |
CREATE_PERMISSION |
|
EDIT_PERMISSION |
|
SOFT_DELETE_PERMISSION |
|
HARD_DELETE_PERMISSION |
|
Methods
Get the user ID of the author who wrote this article
Get the category of the news article
Get the database ID from the category the article belongs into
Get the content of the article
Get the time when the article was submitted
Get the time when the article was last updated
Get the last editor of the post
Get the ID of the person who last edited the article
Get the subject of the news article
Get the name of the entity
Get the name of the object's parameter in the route
Get the name of the route that shows the object
Update the content of a post
Update the last edit timestamp
Update the editor of the post
Update the category of the post
Update the status of a post
Update the subject of a post
Get the possible statuses representing an active model (visible to everyone)
Add a new news article
Get all the news entries in the database that aren't disabled or deleted
Get a query builder for news
Details
at line line 92
Player
getAuthor()
Get the author of the news article
at line line 101
int
getAuthorID()
Get the user ID of the author who wrote this article
at line line 110
NewsCategory
getCategory()
Get the category of the news article
at line line 119
int
getCategoryID()
Get the database ID from the category the article belongs into
at line line 128
string
getContent()
Get the content of the article
at line line 138
TimeDate
getCreated()
Get the time when the article was submitted
at line line 148
TimeDate
getLastEdit()
Get the time when the article was last updated
at line line 157
Player
getLastEditor()
Get the last editor of the post
at line line 166
int
getLastEditorID()
Get the ID of the person who last edited the article
at line line 175
string
getSubject()
Get the subject of the news article
at line line 183
string
getName()
Get the name of the entity
at line line 191
static string
getParamName()
Get the name of the object's parameter in the route
at line line 199
static string
getRouteName(string $action = 'show')
Get the name of the route that shows the object
at line line 211
News
updateContent(string $content)
Update the content of a post
at line line 220
News
updateEditTimestamp()
Update the last edit timestamp
at line line 231
News
updateLastEditor(int $editorID)
Update the editor of the post
at line line 242
News
updateCategory(int $categoryID)
Update the category of the post
at line line 253
News
updateStatus(string $status = 'published')
Update the status of a post
at line line 264
News
updateSubject(string $subject)
Update the subject of a post
at line line 272
static string[]
getActiveStatuses()
Get the possible statuses representing an active model (visible to everyone)
at line line 288
static News
addNews(string $subject, string $content, int $authorID, int $categoryId = 1, string $status = 'published')
Add a new news article
at line line 309
static News[]
getNews(int $start, int $limit = 5, bool $getDrafts = false)
Get all the news entries in the database that aren't disabled or deleted
at line line 329
static QueryBuilder
getQueryBuilder()
Get a query builder for news