NewsCategory
class NewsCategory extends AliasModel
A news category
Constants
TABLE |
The name of the database table used for queries |
Methods
Delete a category. Only delete a category if it is not protected
Disable the category
Enable the category
Get the status of the category
Get all the news entries in the category that aren't disabled or deleted
Check if the category is protected from being deleted
Create a new category
Get all of the categories for the news
Get the possible statuses representing an active model (visible to everyone)
Get a query builder for news categories
Get the name of the object's parameter in the route
Gets a human-readable format of the model's type
Details
at line line 50
void
delete()
Delete a category. Only delete a category if it is not protected
at line line 66
void
disableCategory()
Disable the category
at line line 79
void
enableCategory()
Enable the category
at line line 92
string
getStatus()
Get the status of the category
at line line 106
News[]
getNews(int $start, int $limit = 5, bool $getDrafts = false)
Get all the news entries in the category that aren't disabled or deleted
at line line 127
bool
isProtected()
Check if the category is protected from being deleted
at line line 139
static NewsCategory
addCategory(string $name)
Create a new category
at line line 154
static NewsCategory[]
getCategories()
Get all of the categories for the news
at line line 167
static string[]
getActiveStatuses()
Get the possible statuses representing an active model (visible to everyone)
at line line 176
static QueryBuilder
getQueryBuilder()
Get a query builder for news categories
at line line 190
static string
getParamName()
Get the name of the object's parameter in the route
at line line 198
static string
getTypeForHumans()
Gets a human-readable format of the model's type