Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Joomla-Framework

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5

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 $_error
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 string getError ([ $escaped = false])
Method mixed &getInstance (string $type, [string $prefix = ''])
Method object The getState ([string $property = null])
Method object The &getTable ([string $name = ''], [string $prefix = 'Table'])
Method string setError (string $value)
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 $_error (line 56)

An error message

  • access: protected
string $_name (line 40)

The model (base) name

  • access: protected
string $_state (line 64)

An state object

  • access: protected
Methods
Constructor __construct (line 71)

Constructor

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

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

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

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

Method to get the database connector object

  • return: connector object
  • since: 1.5
  • access: public
object JDatabase &getDBO ()
getError (line 183)

Get the error message

  • return: The error message
  • since: 1.5
string getError ([ $escaped = false])
  • $escaped
getInstance (line 109)

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 = ''])
  • string $type: The model type to instantiate
  • string $prefix: Prefix for the model class name
getState (line 160)

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

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'])
  • string $name: The table name
  • string $prefix: The class prefix
setError (line 199)

Sets the error message

  • return: The new error message
  • since: 1.5
string setError (string $value)
  • string $value: The error message
setState (line 147)

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

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

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::getPublicProperties()
 JObject::set()
 JObject::toString()

Documentation generated on Mon, 05 Mar 2007 21:10:54 +0000 by phpDocumentor 1.3.1