FUEL CMS User Guide : Version 1.5.2


Fuel Assets Model Class

Fuel_assets_model is used for managing asset data with the file system which includes retrieving and deleting images, pdfs, etc.

This class extends the CI_Model class.

Properties Reference

Property Default Value Description
public
filters
array('group_id' => 'images')
The default list view group value for filtering
filter_value none The default filter value
key_field id Placed here to prevent errors since we are not extended Base_module_model
boolean_fields
array()
Placed here to prevent errors since we are not extended Base_module_model
default_file_types jpg|jpeg|jpe|png|gif|mov|mpeg|mp3|wav|aiff|pdf|css Default file types to associate to folders without associations
protected
validator N/A The validator object

Function Reference [+]

$this->fuel->assets_model->table_name()

Placeholder function (not used).

Returns

void

$this->fuel->assets_model->add_filters($filters)

Adds search filters.

Returns

void

Parameters

(array) $filters Search filters

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

Returns an array of data used for the CMS's list view.

Returns

array

Parameters

(int) $limit limit
(string) $offset offset
(string) $col column
(string) $order order

$this->fuel->assets_model->list_items_total()

Returns the number of asset files.

Returns

int

$this->fuel->assets_model->find_by_key('$file')

Returns an array of information about a particular asset file.

Returns

array

Parameters

(string) $file An asset file

$this->fuel->assets_model->get_file('$file')

Returns the name of the file and will decode it if necessary.

Returns

string

Parameters

(string) $file An asset file

$this->fuel->assets_model->record_count(['$dir'='images'])

Returns the number of assets in a given folder.

Returns

int

Parameters

(string) $dir An asset folder

$this->fuel->assets_model->delete('$file')

Deletes an asset.

Returns

string

Parameters

(string) $file An asset file to delete

$this->fuel->assets_model->key_field()

Returns the field to be used as the key for a record.

Returns

string

$this->fuel->assets_model->get_validation()

Get the validation object.

Returns

object

$this->fuel->assets_model->get_errors()

Return validation errors.

Returns

array

$this->fuel->assets_model->form_fields([$values=array()])

Returns an array of form field parameters that can be used by Form_builder.

Returns

array

Parameters

(array) $values An array of values to be passed to the form fields

$this->fuel->assets_model->on_before_post()

Placeholder function (not used).

Returns

void

$this->fuel->assets_model->on_after_post($values)

Placeholder function (not used).

Returns

void

Parameters

(array) $values Posted values

$this->fuel->assets_model->has_auto_increment()

Placeholder function (not used).

Returns

void

$this->fuel->assets_model->filters([$values=array()])

Placeholder function (not used).

Returns

void

Parameters

(array) $values Posted values

Displays the most recently uplloaded.

Returns

mixed Can be an array of items or a string value

Parameters

(array) $params View variable data (optional)

$this->fuel->assets_model->get_module()

Returns the module object for this model.

Returns

object

$this->fuel->assets_model->display_name($values)

Function to return the display name as defined by the display_field in MY_fuel_modules.

Returns

string

Parameters

(array) $values $values The values of the current record