Actions

API17

Difference between revisions of "JModel"

From Joomla! Documentation

m (JoomlaWikiBot moved page JModel/11.1 to API17:JModel without leaving a redirect: Robot: Moved page)
m (moving preparation)
 
(One intermediate revision by one user not shown)
Line 14: Line 14:
 
|-
 
|-
 
|public  
 
|public  
|[[JModel::__construct/11.1|__construct]]
+
|[[API17:JModel::__construct|__construct]]
 
|Constructor.  
 
|Constructor.  
 
|-
 
|-
 
|public  
 
|public  
|[[JModel::getDbo/11.1|getDbo]]
+
|[[API17:JModel::getDbo|getDbo]]
 
|Method to get the database connector object.  
 
|Method to get the database connector object.  
 
|-
 
|-
 
|public  
 
|public  
|[[JModel::getName/11.1|getName]]
+
|[[API17:JModel::getName|getName]]
 
|Method to get the model name.  
 
|Method to get the model name.  
 
|-
 
|-
 
|public  
 
|public  
|[[JModel::getState/11.1|getState]]
+
|[[API17:JModel::getState|getState]]
 
|Method to get model state variables.  
 
|Method to get model state variables.  
 
|-
 
|-
 
|public  
 
|public  
|[[JModel::getTable/11.1|getTable]]
+
|[[API17:JModel::getTable|getTable]]
 
|Method to get a table object, load it if necessary.  
 
|Method to get a table object, load it if necessary.  
 
|-
 
|-
 
|public  
 
|public  
|[[JModel::setDbo/11.1|setDbo]]
+
|[[API17:JModel::setDbo|setDbo]]
 
|Method to set the database connector object.  
 
|Method to set the database connector object.  
 
|-
 
|-
 
|public  
 
|public  
|[[JModel::setState/11.1|setState]]
+
|[[API17:JModel::setState|setState]]
 
|Method to set model state variables.  
 
|Method to set model state variables.  
 
|-
 
|-
 
|public static  
 
|public static  
|[[JModel::addIncludePath/11.1|addIncludePath]]
+
|[[API17:JModel::addIncludePath|addIncludePath]]
 
|Add a directory where  should search for models.  
 
|Add a directory where  should search for models.  
 
|-
 
|-
 
|public static  
 
|public static  
|[[JModel::addTablePath/11.1|addTablePath]]
+
|[[API17:JModel::addTablePath|addTablePath]]
 
|Adds to the stack of model table paths in LIFO order.  
 
|Adds to the stack of model table paths in LIFO order.  
 
|-
 
|-
 
|public static  
 
|public static  
|[[JModel::getInstance/11.1|getInstance]]
+
|[[API17:JModel::getInstance|getInstance]]
 
|Returns a Model object, always creating it.  
 
|Returns a Model object, always creating it.  
 
|-
 
|-
 
|protected  
 
|protected  
|[[JModel::_getList/11.1|_getList]]
+
|[[API17:JModel::_getList|_getList]]
 
|Gets an array of objects from the results of database query.  
 
|Gets an array of objects from the results of database query.  
 
|-
 
|-
 
|protected  
 
|protected  
|[[JModel::_getListCount/11.1|_getListCount]]
+
|[[API17:JModel::_getListCount|_getListCount]]
 
|Returns a record count for the query.  
 
|Returns a record count for the query.  
 
|-
 
|-
 
|protected  
 
|protected  
|[[JModel::populateState/11.1|populateState]]
+
|[[API17:JModel::populateState|populateState]]
 
|Method to auto-populate the model state.  
 
|Method to auto-populate the model state.  
 
|-
 
|-
 
|}
 
|}
 
* '''Defined in''' libraries/joomla/application/component/model.php
 
* '''Defined in''' libraries/joomla/application/component/model.php
* '''Extends''' [[JObject/11.1|JObject]]
+
* '''Extends''' [[API17:JObject|JObject]]
 
* '''Extended by'''
 
* '''Extended by'''
** [[JModelForm/11.1|JModelForm]]
+
** [[API17:JModelForm|JModelForm]]
** [[JModelItem/11.1|JModelItem]]
+
** [[API17:JModelItem|JModelItem]]
** [[JModelList/11.1|JModelList]]
+
** [[API17:JModelList|JModelList]]
 
===Importing===
 
===Importing===
 
<source lang="php">jimport( 'joomla.application.component.model' );</source>
 
<source lang="php">jimport( 'joomla.application.component.model' );</source>
 
===See also===
 
===See also===
 
* {{JVer|11.1}} '''JModel source code''' on [[jplatform:application/component/model.php|BitBucket]]
 
* {{JVer|11.1}} '''JModel source code''' on [[jplatform:application/component/model.php|BitBucket]]
* {{JVer|11.1}} Subpackage [[Subpackage Application/11.1|Application]]
+
* {{JVer|11.1}} Subpackage [[API17:Subpackage Application|Application]]
* [[JModel|Other versions of JModel]]
+
* [[API17:JModel|Other versions of JModel]]
 
{{SeeAlso:JModel}}
 
{{SeeAlso:JModel}}
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
Line 93: Line 93:
 
format= ,,,
 
format= ,,,
 
</dpl>
 
</dpl>
<noinclude>[[Category:Platform JClasses]][[Category:Platform 11.1]][[Category:JModel]]</noinclude>
+
<noinclude>[[Category:Platform 11.1]][[Category:Archived pages API17]]</noinclude>

Latest revision as of 21:12, 11 May 2013

Replacement filing cabinet.png
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.

Joomla 11.1 JModel

Description

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.

[Edit Descripton]

Methods

Visibility Method name Description
public __construct Constructor.
public getDbo Method to get the database connector object.
public getName Method to get the model name.
public getState Method to get model state variables.
public getTable Method to get a table object, load it if necessary.
public setDbo Method to set the database connector object.
public setState Method to set model state variables.
public static addIncludePath Add a directory where should search for models.
public static addTablePath Adds to the stack of model table paths in LIFO order.
public static getInstance Returns a Model object, always creating it.
protected _getList Gets an array of objects from the results of database query.
protected _getListCount Returns a record count for the query.
protected populateState Method to auto-populate the model state.

Importing

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

See also

SeeAlso:JModel [Edit See Also]

User contributed notes

<CodeExamplesForm />