JModel
Base class for a Joomla Model
Acts as a Factory class for application specific objects and provides many supporting API functions.
Located in /libraries/joomla/application/component/model.php (line 22)
JObject (Subpackage Base)
![]()
JModel (Subpackage Application)
| Class | Description |
|---|---|
JModelItem
|
Prototype item model. |
JModelList
|
Model class for handling lists of items. |
JModelForm
|
Prototype form model. |
object
$db
(line 47)
Database Connector
string
$event_clean_cache
= null (line 90)
The event to trigger when cleaning cache.
string
$name
(line 65)
The model (base) name
string
$option
= null (line 73)
The URL option for the component.
string
$state
(line 82)
A state object
boolean
$stateSet
= null (line 30)
Indicates if the internal state has been set
object
$_db
(line 56)
Database Connector
boolean
$__state_set
= null (line 39)
Indicates if the internal state has been set
Inherited Variables
Inherited from JObject
JObject::$_errors
Constructor
- array $config: An array of configuration options (name, state, dbo, table_path, ignore_request).
- JObject::__construct()
- Class constructor, overridden in descendant classes.
- JModelList::__construct() : Constructor.
- JModelAdmin::__construct() : Constructor.
Add a directory where JModel should search for models. You may either pass a string or an array of directories.
- mixed $path: A path or array[sting] of paths to search.
- string $prefix: A prefix for models.
Adds to the stack of model table paths in LIFO order.
- mixed $path: The directory as a string or directories as an array to add.
Clean the cache
- string $group: The cache group
- integer $client_id: The ID of the client
Returns a Model object, always creating it
- string $type: The model type to instantiate
- string $prefix: Prefix for the model class name. Optional.
- array $config: Configuration array for model. Optional.
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
Method to get model state variables
- string $property: Optional parameter name
- mixed $default: Optional default value
Method to get a table object, load it if necessary.
- string $name: The table name. Optional.
- string $prefix: The class prefix. Optional.
- array $options: Configuration array for model. Optional.
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.
- JModelList::populateState() : Method to auto-populate the model state.
- JModelAdmin::populateState() : Stock method to auto-populate the model state.
Method to set the database connector object
- object &$db: A JDatabase based object
Method to set model state variables
- string $property: The name of the property.
- mixed $value: The value of the property to set or null.
Create the filename for a resource
- string $type: The resource type to create the filename for.
- array $parts: An associative array of filename information.
Method to load and return a model object.
- string $name: The name of the view
- string $prefix: The class prefix. Optional.
- array $config: Configuration settings to pass to JTable::getInstance
Gets an array of objects from the results of database query.
- string $query: The query.
- integer $limitstart: Offset.
- integer $limit: The number of records.
Returns a record count for the query
- string $query: The query.
Inherited Methods
Inherited From JObject
JObject::__construct()
JObject::def()
JObject::get()
JObject::getError()
JObject::getErrors()
JObject::getProperties()
JObject::set()
JObject::setError()
JObject::setProperties()
JObject::toString()
JObject::__toString()

JModel (Subpackage Application)
static