Difference between revisions of "JTable"

From Joomla! ドキュメンテーション

(Created page with "<noinclude>{{Languages|API15:JTable}}</noinclude> <noinclude><translate></noinclude> <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Description:JTable|...")

Latest revision as of 00:52, 21 May 2015

[Edit Descripton]

JTable is an abstract class that forms the basis for all database table classes. Some of the methods listed will be overridden by the child class so you should check the child class documentation for further information.

Each physical database table created should have a corresponding class derived from JTable to represent it. JTable provides many methods to make common manipulations to the table much simpler. For example, one of the most common operations you will need to perform is to read a table row into memory given a value for the primary key. This can be done easily using the load method. The table row can then be just as easily updated using the save method, which also performs any predefined sanity checks on the table fields.


Defined in



Method name Description
__construct Object constructor to set table and key field
getInstance Returns a reference to the a Table object, always creating it
getDBO Get the internal database object
setDBO Set the internal database object
getTableName Gets the internal table name for the object
getKeyName Gets the internal primary key name
reset Resets the default properties void
bind Binds a named array/hash to this object
load Loads a row from the database and binds the fields to the object properties
check Generic check method
store Inserts a new row if id is zero or updates an existing row in the database table
move Description
getNextOrder Returns the ordering value to place a new item last in its group
reorder Compacts the ordering sequence of the selected records
canDelete Generic check for whether dependancies exist for this object in the db schema
delete Default delete method
checkout Checks out a row
checkin Checks in a row
hit Description
save Generic save function
publish Generic Publish/Unpublish function
toXML Export item list to xml
addIncludePath Add a directory where JTable should search for table types. You may either pass a string or an array of directories.
isCheckedOut Check if an item is checked out


jimport( 'joomla.database.table' );

[Edit See Also] SeeAlso:JTable


<CodeExamplesForm />