Actions

API15

JTable

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

Revision as of 00:52, 21 May 2015 by Sync (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

[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.

Contents

Defined in

libraries/joomla/database/table.php

Methods

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

Importing

jimport( 'joomla.database.table' );

[Edit See Also] SeeAlso:JTable

Examples

<CodeExamplesForm />