FOFModelFrameworkOnFramework Model class. The Model is the worhorse. It performs all
of the business logic based on its state and then returns the raw (processed) data to the caller, or modifies its own state. It's important to note that the model doesn't get data directly from the request (this is the Controller's business) and that it doesn't output anything (that the View's business).
Located in /libraries/fof/model/model.php (line 22)
JObject | --FOFModel
| Class | Description |
|---|---|
PostinstallModelMessages
|
Model class to manage postinstall messages |
The
getUserStateFromRequest
(string $key, string $request, [string $default = null], [string $type = 'none'], [boolean $setUserState = true])
mixed
loadForm
(string $name, [string $source = null], [array $options = array()], [boolean $clear = false], [string $xpath = false])
array
&_getList
(string $query, [integer $limitstart = 0], [integer $limit = 0], [string $group = ''])
FOFConfigProvider
$configProvider
= null (line 183)
An instance of FOFConfigProvider to provision configuration overrides
array
$default_behaviors
= array('filters') (line 197)
Default behaviors to apply to the model
string
$event_after_delete
= 'onContentAfterDelete' (line 44)
The event to trigger after deleting the data.
string
$event_after_save
= 'onContentAfterSave' (line 50)
The event to trigger after saving the data.
string
$event_before_delete
= 'onContentBeforeDelete' (line 56)
The event to trigger before deleting the data.
string
$event_before_save
= 'onContentBeforeSave' (line 62)
The event to trigger before saving the data.
string
$event_change_state
= 'onContentChangeState' (line 68)
The event to trigger after changing the published state of the data.
string
$event_clean_cache
= null (line 76)
The event to trigger when cleaning cache.
int
$id
= null (line 88)
The first row ID passed to the model's state
array
$id_list
= array() (line 82)
Stores a list of IDs passed to the model's state
array
$input
= array() (line 94)
Input variables, passed on from the controller, in an associative array
array
$list
= null (line 100)
The list of records made available through getList
FOFModelDispatcherBehavior
$modelDispatcher
= null (line 190)
FOFModelDispatcherBehavior for dealing with extra behaviors
string
$name
(line 108)
The model (base) name
string
$option
= null (line 116)
The URL option for the component.
JPagination
$pagination
= null (line 128)
Pagination object
string
$state
(line 142)
A state object
string
$table
= null (line 148)
The name of the table to use
int
$total
= null (line 154)
Total rows based on the filters set in the model's state
object
$_db
(line 38)
Database Connector
array
$_formData
= array() (line 176)
The data to load into a form
array
$_forms
= array() (line 168)
Array of form objects.
bool
$_savestate
= null (line 160)
Should I save the model's state in the session?
boolean
$__state_set
= null (line 30)
Indicates if the internal state has been set
Inherited from JObject
JObject::$_errors
Add a directory where FOFModel should search for models. You may either pass a string or an array of directories.
Adds to the stack of model table paths in LIFO order.
Returns a new model object. Unless overriden by the $config array, it will try to automatically populate its state from the request variables.
Returns a new instance of a model, with the state reset to defaults
Create the filename for a resource
Public class constructor
Adds a behavior to the model
Applies view access level filtering for the specified user. Useful to filter a front-end items listing.
Builds the SELECT query
Clean the cache
Clears the model state, but doesn't touch the internal lists of records, record tables or record id variables. To clear these values, please use reset().
Guesses the best candidate for the path to use for a particular form.
A cross-breed between getItem and getItemList. It runs the complete query, like getItemList does. However, instead of returning an array of ad-hoc objects, it binds the data from the first item fetched on the list to an instance of the table object and returns that table object instead.
A method for getting the form from the model.
Returns a hash for this component and view, e.g. "foobar.items.", used for determining the keys of the variables which will be placed in the session storage.
Returns a single item. It uses the id set with setId, or the first ID in the list of IDs for batch operations
Returns a list of items
Alias for getItemList
Method to get the model name
The model name. By default parsed using the classname or it can be set by passing a $config['name'] in the class constructor
Returns the table object after the last save() operation
Get a filtered state variable
Method to get a table object, load it if necessary.
Returns a list of the fields of the table associated with this model
Gets the value of a user state variable.
Tells you if the current item is checked out or not
Method to get a form object.
Method to get the data that should be injected in the form.
Moves the current item up or down in the ordering list
This method runs after a record has been copied
This method runs after a record with key value $id is deleted
This method runs after an item has been gotten from the database in a read operation. You can modify it before it's returned to the MVC triad for further processing.
This method runs after a record has been hit
Allows the manipulation after the form is loaded
This method runs after a record has been moved
Allows data and form manipulation after preprocessing the form
This method runs after a record has been published
This method runs after a table is reordered
This method runs after the data is saved to the $table.
This method runs before a record is copied
This method runs before the record with key value of $id is deleted from $table
This method runs before a record is hit
Allows the manipulation before the form is loaded
This method runs before a record is moved
Allows data and form manipulation before preprocessing the form
This method runs before a record is published
This method runs before a table is reordered
This method runs before the $data is saved to the $table. Return false to stop saving.
This method can be overriden to automatically do something with the list results array. You are supposed to modify the list which was passed in the parameters; DO NOT return a new array!
Initialises the _savestate variable
Method to auto-populate the model state.
This method should only be called once per instantiation and is designed to be called on the first call to the getState() method unless the model configuration flag to ignore the request is set.
Method to allow derived classes to preprocess the form.
Toggles the published state of one or several items
Binds the data to the model and tries to save it
Sets the model state auto-save status. By default the model is set up to save its state to the session.
Method to set the database driver object
Sets the ID and resets internal data
Sets a list of IDs for batch operations from an array and resets the model
Sets the list of IDs from the request data
Method to set model state variables
Method to validate the form data.
Method to load and return a model object.
Returns an object list
Returns a record count for the query
Method to get model state variables
Magic caller; allows to use the name of model state keys as methods to set their values.
Magic getter; allows to use the name of model state keys as properties
Magic setter; allows to use the name of model state keys as properties
Inherited From JObject
JObject::__construct()
JObject::def()
JObject::get()
JObject::getError()
JObject::getErrors()
JObject::getProperties()
JObject::set()
JObject::setError()
JObject::setProperties()
JObject::__toString()
Documentation generated on Tue, 19 Nov 2013 15:08:34 +0100 by phpDocumentor 1.4.3