FUEL CMS User Guide : Version 1.4


Fuel Categories Model Class

Fuel_categories_model is used for managing FUEL categories in the CMS.

This class extends the Base_module_model class.

Properties Reference

Property Default Value Description
public
required
array('name', 'slug')
Name and slug are required
filters
array('name', 'slug', 'context')
Allows for the description field to be searchable as well as the name field
linked_fields
array('slug' => 'name')
The slug value should be the name field's value with the url_title function applied to it if there is no value specified
unique_fields
array('slug')
The slug field needs to be unique
protected
friendly_name N/A
singular_name N/A

Function Reference [+]

$this->fuel->categories_model->list_items(['$limit'=NULL], ['$offset'=NULL], ['$col'='name'], ['$order'='asc'], ['$just_count'=FALSE])

Lists the module's items.

Returns

mixed If $just_count is true it will return an integer value. Otherwise it will return an array of data (optional)

Parameters

(int) $limit The limit value for the list data (optional)
(int) $offset The offset value for the list data (optional)
(string) $col The field name to order by (optional)
(string) $order The sorting order (optional)
(boolean) $just_count Determines whether the result is just an integer of the number of records or an array of data (optional)

$this->fuel->categories_model->context_options_list()

Initializes the class with the parent model and field names.

Returns

array

$this->fuel->categories_model->tree(['$just_published'=FALSE])

Tree view that puts categories in a hierarchy based on their parent value.

Returns

array An array that can be used by the Menu class to create a hierachical structure

Parameters

(boolean) $just_published Determines whether to return just published pages or not (optional... and ignored in the admin)

$this->fuel->categories_model->form_fields([$values=array()], [$related=array()])

Creates the form_fields array to be used with Form_builder.

Returns

array

Parameters

(array) $values an array of values to pass to the form fields
(array) $related related field information

$this->fuel->categories_model->_common_query(['$params'=NULL])

Overwrites the _common_query parent method to automatically sort by precedence value.

Returns

array

Parameters

(mixed) $params parameter to pass to common query (optional)


Fuel Category Model Class

This class extends the Base_module_record class.

Properties Reference

Property Default Value Description
public
_belongs_to
array()

Function Reference [+]

$this->fuel->category_model->initialize('$parent', [$fields=array()])

Initializes the class with the parent model and field names.

Returns

array

Parameters

(object) $parent parent model object
(array) $fields field names

$this->fuel->category_model->get('$var')

Returns a related category model with the active record query already applied.

Returns

array

Parameters

(string) $var related slug value

$this->fuel->category_model->get_children([$where=array()], ['$order'=NULL], ['$limit'=NULL], ['$offset'=NULL])

Find the children.

Returns

mixed

Parameters

(mixed) $where where conditions
(string) $order the order by of the query (optional)
(int) $limit the number of records to limit in the results (optional)
(int) $offset the offset value for the results (optional)

$this->fuel->category_model->__call('$method', $args)

Magic method that will allow you to return the model object by doing something like $cateogry->get_products(TRUE);.

Returns

mixed

Parameters

(string) $method field name
(array) $args arguments

$this->fuel->category_model->__get('$var')

Magic method to return first property, method, then field values.

Returns

mixed

Parameters

(string) $var field name