Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Joomla-Framework

License

Content on this site is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5. Some parts of this website may be subject to other licenses.

Abstract Class JModel

Description

Base class for a Joomla Model

Acts as a Factory class for application specific objects and provides many supporting API functions.

Located in /joomla/application/component/model.php (line 32)

Class JObject   (Subpackage Base)

Abstract class JModel   (Subpackage Application)
Variable Summary
Variable object $_db
Variable string $_name
Variable string $_state
Method Summary
Static method static void addTablePath (string|array $path)
Constructor JModel __construct ([ $config = array()])
Method array addIncludePath ([string $path = ''])
Method mixed &getInstance (string $type, [string $prefix = ''], [array $config = array()])
Method string getName ()
Method object The getState ([string $property = null])
Method object The &getTable ([string $name = ''], [string $prefix = 'Table'], [array $options = array()])
Method void setDBO ( &$db, object $db)
Method mixed setState (string $property, [mixed $value = null])
Method array &_getList (string $query, [int $limitstart = 0], [int $limit = 0])
Method int _getListCount (string $query)
Variables
object $_db (line 48)

Database Connector

  • access: protected
string $_name (line 40)

The model (base) name

  • access: protected
string $_state (line 56)

An state object

  • access: protected

Inherited Variables

Inherited from JObject

Variable JObject::$_errors
Methods
Constructor __construct (line 63)

Constructor

  • since: 1.5
JModel __construct ([ $config = array()])
  • $config

Redefinition of:
JObject::__construct()
Class constructor, overridden in descendant classes.
addIncludePath (line 247)

Add a directory where JModel should search for models. You may either pass a string or an array of directories.

  • return: An array with directory elements
  • since: 1.5
  • access: public
array addIncludePath ([string $path = ''])
  • string $path: A path to search.
addTablePath (line 268)

Adds to the stack of model table paths in LIFO order.

void addTablePath (string|array $path)
  • string|array $path: The directory (-ies) to add.
getDBO (line 170)

Method to get the database connector object

  • return: connector object
  • since: 1.5
  • access: public
object JDatabase &getDBO ()
getInstance (line 106)

Returns a reference to the a Model object, always creating it

  • return: A model object, or false on failure
  • since: 1.5
mixed &getInstance (string $type, [string $prefix = ''], [array $config = array()])
  • string $type: The model type to instantiate
  • string $prefix: Prefix for the model class name. Optional.
  • array $config: Configuration array for model. Optional.
getName (line 197)

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

  • return: The name of the model
  • since: 1.5
  • access: public
string getName ()
getState (line 158)

Method to get model state variables

  • return: property where specified, the state object where omitted
  • since: 1.5
  • access: public
object The getState ([string $property = null])
  • string $property: Optional parameter name
getTable (line 223)

Method to get a table object, load it if necessary.

  • return: table
  • since: 1.5
  • access: public
object The &getTable ([string $name = ''], [string $prefix = 'Table'], [array $options = array()])
  • string $name: The table name. Optional.
  • string $prefix: The class prefix. Optional.
  • array $options: Configuration array for model. Optional.
setDBO (line 182)

Method to set the database connector object

  • since: 1.5
void setDBO ( &$db, object $db)
  • object $db: A JDatabase based object
  • &$db
setState (line 145)

Method to set model state variables

  • return: The previous value of the property
  • since: 1.5
  • access: public
mixed setState (string $property, [mixed $value = null])
  • string $property: The name of the property
  • mixed $value: The value of the property to set
_getList (line 284)

Returns an object list

  • since: 1.5
  • access: protected
array &_getList (string $query, int $limitstart, int $limit)
  • string $query: The query
  • int $limitstart: Offset
  • int $limit: The number of records
_getListCount (line 300)

Returns a record count for the query

  • since: 1.5
  • access: protected
int _getListCount (string $query)
  • string $query: The query

Inherited Methods

Inherited From JObject

 JObject::JObject()
 JObject::__construct()
 JObject::get()
 JObject::getError()
 JObject::getErrors()
 JObject::getProperties()
 JObject::getPublicProperties()
 JObject::set()
 JObject::setError()
 JObject::setProperties()
 JObject::toString()

Documentation generated on Tue, 29 Jan 2008 18:48:27 +0000 by phpDocumentor 1.3.1