Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe BaseDatabaseModel
+ Graphe d'héritage de BaseDatabaseModel:

Fonctions membres publiques

 __construct ($config=array(), MVCFactoryInterface $factory=null)
 
 getDbo ()
 
 getName ()
 
 getState ($property=null, $default=null)
 
 getTable ($name='', $prefix='Table', $options=array())
 
 loadHistory ($versionId, \JTable &$table)
 
 setDbo ($db)
 
 setState ($property, $value=null)
 

Fonctions membres publiques statiques

static addIncludePath ($path='', $prefix='')
 
static addTablePath ($path)
 
static getInstance ($type, $prefix='', $config=array())
 

Fonctions membres protégées

 _getList ($query, $limitstart=0, $limit=0)
 
 _getListCount ($query)
 
 _createTable ($name, $prefix='Table', $config=array())
 
 populateState ()
 

Fonctions membres protégées statiques

static _createFileName ($type, $parts=array())
 

Attributs protégés

 $__state_set = null
 
 $_db
 
 $name
 
 $option = null
 
 $state
 
 $event_clean_cache = null
 
 $factory
 

Description détaillée

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

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $config = array(),
MVCFactoryInterface  $factory = null 
)

Constructor

Paramètres
array$configAn array of configuration options (name, state, dbo, table_path, ignore_request).
MVCFactoryInterface$factoryThe factory.
Depuis
3.0
Exceptions

Références $config, $r, elseif, JPATH_COMPONENT_ADMINISTRATOR, name, null, et option.

Documentation des fonctions membres

◆ _createFileName()

static _createFileName (   $type,
  $parts = array() 
)
staticprotected

Create the filename for a resource

Paramètres
string$typeThe resource type to create the filename for.
array$partsAn 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$nameThe name of the view
string$prefixThe class prefix. Optional.
array$configConfiguration 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$queryThe query.
integer$limitstartOffset.
integer$limitThe number of records.
Renvoie
object[] An array of results.
Depuis
3.0
Exceptions

Références $limit, et $query.

◆ _getListCount()

_getListCount (   $query)
protected

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$queryThe 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$pathA path or array[sting] of paths to search.
string$prefixA 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$pathThe directory as a string or directories as an array to add.
Renvoie
void
Depuis
3.0

Références $path.

◆ getDbo()

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$typeThe model type to instantiate
string$prefixPrefix for the model class name. Optional.
array$configConfiguration 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()

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$propertyOptional parameter name
mixed$defaultOptional 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$nameThe table name. Optional.
string$prefixThe class prefix. Optional.
array$optionsConfiguration 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$versionIdKey to the version history table.
\JTable&$tableContent table object being loaded.
Renvoie
boolean False on failure or error, true otherwise.
Depuis
3.2

Références $key, et ArrayHelper\fromObject().

◆ populateState()

populateState ( )
protected

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()

setDbo (   $db)

Method to set the database driver object

Paramètres
\JDatabaseDriver$dbA 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$propertyThe name of the property.
mixed$valueThe 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.

Documentation des champs

◆ $__state_set

$__state_set = null
protected

◆ $_db

$_db
protected

◆ $event_clean_cache

$event_clean_cache = null
protected

◆ $factory

$factory
protected

◆ $name

$name
protected

◆ $option

$option = null
protected

◆ $state

$state
protected

La documentation de cette classe a été générée à partir du fichier suivant :