Base class for a database aware Joomla Model
Acts as a Factory class for application specific objects and provides many supporting API functions.
- Depuis
- 2.5.5
◆ __construct()
Constructor
- Paramètres
-
array | $config | An array of configuration options (name, state, dbo, table_path, ignore_request). |
MVCFactoryInterface | $factory | The factory. |
- Depuis
- 3.0
- Exceptions
-
Références $config, $r, elseif, JPATH_COMPONENT_ADMINISTRATOR, name, null, et option.
◆ _createFileName()
static _createFileName |
( |
|
$type, |
|
|
|
$parts = array() |
|
) |
| |
|
staticprotected |
Create the filename for a resource
- Paramètres
-
string | $type | The resource type to create the filename for. |
array | $parts | An associative array of filename information. |
- Renvoie
- string The filename
- Depuis
- 3.0
Références $parts, et $type.
◆ _createTable()
_createTable |
( |
|
$name, |
|
|
|
$prefix = 'Table' , |
|
|
|
$config = array() |
|
) |
| |
|
protected |
Method to load and return a model object.
- Paramètres
-
string | $name | The name of the view |
string | $prefix | The class prefix. Optional. |
array | $config | Configuration settings to pass to ::getInstance |
- Renvoie
- |boolean Table object or boolean false if failed
- Depuis
- 3.0
- Voir également
- ::getInstance()
Références $config, $name, $prefix, et null.
◆ _getList()
_getList |
( |
|
$query, |
|
|
|
$limitstart = 0 , |
|
|
|
$limit = 0 |
|
) |
| |
|
protected |
Gets an array of objects from the results of database query.
- Paramètres
-
string | $query | The query. |
integer | $limitstart | Offset. |
integer | $limit | The number of records. |
- Renvoie
- object[] An array of results.
- Depuis
- 3.0
- Exceptions
-
Références $limit, et $query.
◆ _getListCount()
Returns a record count for the query.
Note: Current implementation of this method assumes that getListQuery() returns a set of unique rows, thus it uses SELECT COUNT(*) to count the rows. In cases that getListQuery() uses DISTINCT then either this method must be overridden by a custom implementation at the derived Model Class or a GROUP BY clause should be used to make the set unique.
- Paramètres
-
\JDatabaseQuery | string | $query | The query. |
- Renvoie
- integer Number of rows for query.
- Depuis
- 3.0
Références $query, et null.
◆ addIncludePath()
static addIncludePath |
( |
|
$path = '' , |
|
|
|
$prefix = '' |
|
) |
| |
|
static |
Add a directory where should search for models. You may either pass a string or an array of directories.
- Paramètres
-
mixed | $path | A path or array[sting] of paths to search. |
string | $prefix | A prefix for models. |
- Renvoie
- array An array with directory elements. If prefix is equal to '', all directories are returned.
- Depuis
- 3.0
Références $path, $prefix, et jimport().
◆ addTablePath()
static addTablePath |
( |
|
$path | ) |
|
|
static |
Adds to the stack of model table paths in LIFO order.
- Paramètres
-
mixed | $path | The directory as a string or directories as an array to add. |
- Renvoie
- void
- Depuis
- 3.0
Références $path.
◆ getDbo()
Method to get the database driver object
- Renvoie
- Depuis
- 3.0
◆ getInstance()
static getInstance |
( |
|
$type, |
|
|
|
$prefix = '' , |
|
|
|
$config = array() |
|
) |
| |
|
static |
Returns a Model object, always creating it
- Paramètres
-
string | $type | The model type to instantiate |
string | $prefix | Prefix for the model class name. Optional. |
array | $config | Configuration array for model. Optional. |
- Renvoie
- |boolean A instance or false on failure
- Depuis
- 3.0
Références $config, $path, $prefix, $type, jimport(), et null.
Référencé par LegacyFactory\createModel().
◆ getName()
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
- Renvoie
- string The name of the model
- Depuis
- 3.0
- Exceptions
-
Références $name, $r, name, et null.
◆ getState()
getState |
( |
|
$property = null , |
|
|
|
$default = null |
|
) |
| |
Method to get model state variables
- Paramètres
-
string | $property | Optional parameter name |
mixed | $default | Optional default value |
- Renvoie
- mixed The property where specified, the state object where omitted
- Depuis
- 3.0
Références $default, et null.
◆ getTable()
getTable |
( |
|
$name = '' , |
|
|
|
$prefix = 'Table' , |
|
|
|
$options = array() |
|
) |
| |
Method to get a table object, load it if necessary.
- Paramètres
-
string | $name | The table name. Optional. |
string | $prefix | The class prefix. Optional. |
array | $options | Configuration array for model. Optional. |
- Renvoie
- A object
- Depuis
- 3.0
- Exceptions
-
Références $name, $options, et $prefix.
◆ loadHistory()
loadHistory |
( |
|
$versionId, |
|
|
\JTable & |
$table |
|
) |
| |
Method to load a row for editing from the version history table.
- Paramètres
-
integer | $versionId | Key to the version history table. |
\JTable | &$table | Content table object being loaded. |
- Renvoie
- boolean False on failure or error, true otherwise.
- Depuis
- 3.2
Références $key, et ArrayHelper\fromObject().
◆ populateState()
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.
- Renvoie
- void
- Note
- Calling getState in this method will result in recursion.
- Depuis
- 3.0
◆ setDbo()
Method to set the database driver object
- Paramètres
-
\JDatabaseDriver | $db | A based object |
- Renvoie
- void
- Depuis
- 3.0
Références $db.
◆ setState()
setState |
( |
|
$property, |
|
|
|
$value = null |
|
) |
| |
Method to set model state variables
- Paramètres
-
string | $property | The name of the property. |
mixed | $value | The value of the property to set or null. |
- Renvoie
- mixed The previous value of the property or null if not set.
- Depuis
- 3.0
Références $value.
◆ $__state_set
◆ $_db
◆ $event_clean_cache
$event_clean_cache = null |
|
protected |
◆ $factory
◆ $name
◆ $option
◆ $state
La documentation de cette classe a été générée à partir du fichier suivant :