CmsLayoutTemplateCategory
in package
A class representing a template category.
Templates can be optionally organized into categories, this class manages the category itself.
Tags
Table of Contents
Methods
- delete() : mixed
- Delete this object from the database
- get_all() : array<string|int, mixed>
- Load a set of categories from the database
- get_description() : string
- Get the category description
- get_id() : int
- Get the category id
- get_item_order() : int
- Get the category order
- get_modified() : int
- Get the date that this category was last saved to the database
- get_name() : string
- Get the category name
- load() : self
- Load a category object from the database
- save() : mixed
- Save this object to the database
- set_description() : mixed
- Set the category description
- set_item_order() : mixed
- Set the item order.
- set_name() : mixed
- Set the category name.
- validate() : mixed
- Validate the correctness of this object
Methods
delete()
Delete this object from the database
public
delete() : mixed
This method will delete the object from the database, and erase the item order and id values from this object, suitable for re-saving
Tags
get_all()
Load a set of categories from the database
public
static get_all([string $prefix = '' ]) : array<string|int, mixed>
Parameters
- $prefix : string = ''
-
An optional category name prefix.
Return values
array<string|int, mixed> —Array of CmsLayoutTemplateCategory objects
get_description()
Get the category description
public
get_description() : string
Return values
stringget_id()
Get the category id
public
get_id() : int
Return values
intget_item_order()
Get the category order
public
get_item_order() : int
Return values
intget_modified()
Get the date that this category was last saved to the database
public
get_modified() : int
Return values
int —The unix timestamp from the database
get_name()
Get the category name
public
get_name() : string
Return values
stringload()
Load a category object from the database
public
static & load(int|string $val) : self
Parameters
- $val : int|string
-
Either the integer category id, or the category name
Tags
Return values
selfsave()
Save this object to the database
public
save() : mixed
Tags
set_description()
Set the category description
public
set_description(string $str) : mixed
Parameters
- $str : string
-
The description
set_item_order()
Set the item order.
public
set_item_order(int $idx) : mixed
The item order must be unique and incremental no validation is done on the item order in this method.
Parameters
- $idx : int
set_name()
Set the category name.
public
set_name(sting $str) : mixed
The category name must be unique, and can only contain certain characters.
Parameters
- $str : sting
-
The template type name.
Tags
validate()
Validate the correctness of this object
protected
validate() : mixed