JModel/1.5

From Joomla! Documentation
< JModel
Revision as of 16:20, 17 April 2011 by Doxiki2 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

[Edit Descripton] JModel is an abstract class which provides the basic functionality for concrete model objects in conjunction with Joomla's MVC pattern. Models that extend the JModel class are often defined in Joomla components and define the business logic of the specific component. See MVC Development in Joomla

The Joomla MVC Design Pattern

Model-View-Controller (MVC) is a set of design patterns, that are used to separate the different layers of your application.

  • The View displays the data of the model by passing it to a template. The view object can therefore access the data of the model. Joomla implements the basic functionality in the abstract JView class.
  • The Model stores the data of the application, and contains the business logic. Joomla implements the basic functionality in the abstract JModel class.
  • The Controller handles the user requests and evokes the model and the views to change it's state. Joomla implements the basic functionality in the JController class.

Defined in

libraries/joomla/application/component/model.php

Subpackage

Application

Extends

JObject

Extended by

Methods

Method name Description
__construct Constructor.
_createFileName Create the filename for a resource.
_createTable Method to load and return a model object.
_getList Returns an object list.
_getListCount Returns a record count for the query.
addIncludePath Add a directory where should search for models.
getDBO Method to get the database connector object.
getInstance Returns a reference to the a Model object, always creating it.
getName Method to get the model name.
getState Method to get model state variables.
getTable Method to get a table object, load it if necessary.
setDBO Method to set the database connector object.
setState Method to set model state variables.
addTablePath Adds to the stack of model table paths in LIFO order.

Importing

jimport( 'joomla.application.component.model' );

See also

[Edit See Also] SeeAlso:JModel

Examples

<CodeExamplesForm />


Personal tools
Namespaces

Variants
Actions
Navigation
Joomla! Sites
Toolbox