JModel/1.5

From Joomla! Documentation
< JModel(Difference between revisions)
Jump to: navigation, search
(Bulk upload by Doxiki2)
 
m (See also: fixing link to API)
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 +
=={{JVer|1.5}} JModel==
 +
===Description===
 +
{{Description:JModel}}
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[Description:JModel|Edit Descripton]]<nowiki>]</nowiki>
 
<nowiki>[</nowiki>[[Description:JModel|Edit Descripton]]<nowiki>]</nowiki>
 
</span>
 
</span>
{{Description:JModel}}
 
===Defined in===
 
libraries/joomla/application/component/model.php
 
===Subpackage===
 
[[Subpackage Application/1.5|Application]]
 
===Extends===
 
[[JObject/1.5|JObject]]
 
===Extended by===
 
 
===Methods===
 
===Methods===
 
{| class="wikitable sortable"
 
{| class="wikitable sortable"
 
|-
 
|-
 +
!Visibility
 
!Method name
 
!Method name
 
!Description
 
!Description
 
|-
 
|-
 +
|public
 
|[[JModel::__construct/1.5|__construct]]
 
|[[JModel::__construct/1.5|__construct]]
 
|Constructor.  
 
|Constructor.  
 
|-
 
|-
 +
|public
 
|[[JModel::_createFileName/1.5|_createFileName]]
 
|[[JModel::_createFileName/1.5|_createFileName]]
 
|Create the filename for a resource.  
 
|Create the filename for a resource.  
 
|-
 
|-
 +
|public 
 
|[[JModel::_createTable/1.5|_createTable]]
 
|[[JModel::_createTable/1.5|_createTable]]
 
|Method to load and return a model object.  
 
|Method to load and return a model object.  
 
|-
 
|-
 +
|public 
 
|[[JModel::_getList/1.5|_getList]]
 
|[[JModel::_getList/1.5|_getList]]
 
|Returns an object list.  
 
|Returns an object list.  
 
|-
 
|-
 +
|public
 
|[[JModel::_getListCount/1.5|_getListCount]]
 
|[[JModel::_getListCount/1.5|_getListCount]]
 
|Returns a record count for the query.  
 
|Returns a record count for the query.  
 
|-
 
|-
 +
|public
 
|[[JModel::addIncludePath/1.5|addIncludePath]]
 
|[[JModel::addIncludePath/1.5|addIncludePath]]
 
|Add a directory where  should search for models.  
 
|Add a directory where  should search for models.  
 
|-
 
|-
 +
|public 
 
|[[JModel::getDBO/1.5|getDBO]]
 
|[[JModel::getDBO/1.5|getDBO]]
 
|Method to get the database connector object.  
 
|Method to get the database connector object.  
 
|-
 
|-
 +
|public 
 
|[[JModel::getInstance/1.5|getInstance]]
 
|[[JModel::getInstance/1.5|getInstance]]
 
|Returns a reference to the a Model object, always creating it.  
 
|Returns a reference to the a Model object, always creating it.  
 
|-
 
|-
 +
|public
 
|[[JModel::getName/1.5|getName]]
 
|[[JModel::getName/1.5|getName]]
 
|Method to get the model name.  
 
|Method to get the model name.  
 
|-
 
|-
 +
|public
 
|[[JModel::getState/1.5|getState]]
 
|[[JModel::getState/1.5|getState]]
 
|Method to get model state variables.  
 
|Method to get model state variables.  
 
|-
 
|-
 +
|public 
 
|[[JModel::getTable/1.5|getTable]]
 
|[[JModel::getTable/1.5|getTable]]
 
|Method to get a table object, load it if necessary.  
 
|Method to get a table object, load it if necessary.  
 
|-
 
|-
 +
|public
 
|[[JModel::setDBO/1.5|setDBO]]
 
|[[JModel::setDBO/1.5|setDBO]]
 
|Method to set the database connector object.  
 
|Method to set the database connector object.  
 
|-
 
|-
 +
|public
 
|[[JModel::setState/1.5|setState]]
 
|[[JModel::setState/1.5|setState]]
 
|Method to set model state variables.  
 
|Method to set model state variables.  
 
|-
 
|-
 +
|public
 
|[[JModel::addTablePath/1.5|addTablePath]]
 
|[[JModel::addTablePath/1.5|addTablePath]]
 
|Adds to the stack of model table paths in LIFO order.  
 
|Adds to the stack of model table paths in LIFO order.  
 
|-
 
|-
 
|}
 
|}
 +
* '''Defined in''' libraries/joomla/application/component/model.php
 +
* '''Extends''' [[JObject/1.5|JObject]]
 
===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|1.5}} '''JModel''' on [http://api.joomla.org/1.5/Joomla-Framework/Application/JModel.html api.joomla.org]
 +
* {{JVer|1.5}} '''JModel source code''' on [[jframework15:application/component/model.php|JoomlaCode]]
 +
* {{JVer|1.5}} Subpackage [[Subpackage Application/1.5|Application]]
 +
* [[JModel|Other versions of JModel]]
 +
{{SeeAlso:JModel}}
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JModel|Edit See Also]]<nowiki>]</nowiki>
 
<nowiki>[</nowiki>[[SeeAlso:JModel|Edit See Also]]<nowiki>]</nowiki>
 
</span>
 
</span>
{{SeeAlso:JModel}}
+
===User contributed notes===
* [[JModel|Other versions of this class]]
+
* [http://api.joomla.org/Joomla-Framework/Application/JModel.html JModel on api.joomla.org]
+
===Examples===
+
 
<CodeExamplesForm />
 
<CodeExamplesForm />
 
<dpl>
 
<dpl>
Line 77: Line 91:
 
category=ClassExample
 
category=ClassExample
 
include=*
 
include=*
 +
namespace=CodeExample
 
format= ,,,
 
format= ,,,
 
</dpl>
 
</dpl>
 
<noinclude>[[Category:Framework]][[Category:Framework 1.5]][[Category:JModel]]</noinclude>
 
<noinclude>[[Category:Framework]][[Category:Framework 1.5]][[Category:JModel]]</noinclude>

Latest revision as of 16:04, 13 February 2013

[edit] Joomla 1.5 JModel

[edit] 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

[edit] 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]

[edit] Methods

Visibility Method name Description
public __construct Constructor.
public _createFileName Create the filename for a resource.
public _createTable Method to load and return a model object.
public _getList Returns an object list.
public _getListCount Returns a record count for the query.
public addIncludePath Add a directory where should search for models.
public getDBO Method to get the database connector object.
public getInstance Returns a reference to the a Model object, always creating it.
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 addTablePath Adds to the stack of model table paths in LIFO order.
  • Defined in libraries/joomla/application/component/model.php
  • Extends JObject

[edit] Importing

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

[edit] See also

SeeAlso:JModel [Edit See Also]

[edit] User contributed notes

<CodeExamplesForm />


Personal tools
Namespaces

Variants
Actions
Navigation
Joomla! Sites
Toolbox