API17:JModel
From Joomla! Documentation
(Difference between revisions)
(Bulk upload by Doxiki2) |
(Layout updates) |
||
| Line 6: | Line 6: | ||
===Defined in=== | ===Defined in=== | ||
libraries/joomla/application/component/model.php | libraries/joomla/application/component/model.php | ||
| + | * see source code in [[jplatform:application/component/model.php|BitBucket]] | ||
===Subpackage=== | ===Subpackage=== | ||
[[Subpackage Application/11.1|Application]] | [[Subpackage Application/11.1|Application]] | ||
| Line 63: | Line 64: | ||
<source lang="php">jimport( 'joomla.application.component.model' );</source> | <source lang="php">jimport( 'joomla.application.component.model' );</source> | ||
===See also=== | ===See also=== | ||
| + | * JModel source code in [[jplatform:application/component/model.php|BitBucket]] | ||
* [[JModel|Other versions of this class]] | * [[JModel|Other versions of this class]] | ||
{{SeeAlso:JModel}} | {{SeeAlso:JModel}} | ||
Revision as of 17:59, 23 April 2011
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
[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
- see source code in BitBucket
Subpackage
Extends
Extended by
Methods
| Method name | Description |
|---|---|
| __construct | Constructor. |
| getDbo | Method to get the database connector object. |
| 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. |
| addIncludePath | Add a directory where should search for models. |
| addTablePath | Adds to the stack of model table paths in LIFO order. |
| getInstance | Returns a Model object, always creating it. |
| _getList | Gets an array of objects from the results of database query. |
| _getListCount | Returns a record count for the query. |
| populateState | Method to auto-populate the model state. |
Importing
jimport( 'joomla.application.component.model' );
See also
- JModel source code in BitBucket
- Other versions of this class
SeeAlso:JModel [Edit See Also]
Examples
<CodeExamplesForm />
