Joomla CMS  2.5.24 (avec JPlatform 11.4 inclus)
Documentation des API du CMS Joomla en version 2.5 et du framework Joomla Platform intégré
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe JTable
+ Graphe d'héritage de JTable:
+ Graphe de collaboration de JTable:

Liste de tous les membres

Fonctions membres publiques

 __construct ($table, $key, &$db)
 getFields ()
 getTableName ()
 getKeyName ()
 getDbo ()
 setDBO (&$db)
 setRules ($input)
 getRules ()
 reset ()
 bind ($src, $ignore=array())
 load ($keys=null, $reset=true)
 check ()
 store ($updateNulls=false)
 save ($src, $orderingFilter= '', $ignore= '')
 delete ($pk=null)
 checkOut ($userId, $pk=null)
 checkIn ($pk=null)
 hit ($pk=null)
 isCheckedOut ($with=0, $against=null)
 getNextOrder ($where= '')
 reorder ($where= '')
 move ($delta, $where= '')
 publish ($pks=null, $state=1, $userId=0)
 canDelete ($pk=null, $joins=null)
 toXML ($mapKeysToText=false)
- Fonctions membres publiques inherited from JObject
 __construct ($properties=null)
 __toString ()
 def ($property, $default=null)
 get ($property, $default=null)
 getProperties ($public=true)
 getError ($i=null, $toString=true)
 getErrors ()
 set ($property, $value=null)
 setProperties ($properties)
 setError ($error)
 toString ()

Fonctions membres publiques statiques

static getInstance ($type, $prefix= 'JTable', $config=array())
static addIncludePath ($path=null)

Fonctions membres protégées

 _getAssetName ()
 _getAssetTitle ()
 _getAssetParentId ($table=null, $id=null)
 _lock ()
 _unlock ()

Attributs protégés

 $_tbl = ''
 $_tbl_key = ''
 $_db
 $_trackAssets = false
 $_rules
 $_locked = false
- Attributs protégés inherited from JObject
 $_errors = array()

Documentation des constructeurs et destructeur

JTable::__construct (   $table,
  $key,
$db 
)

Object constructor to set table and key fields. In most cases this will be overridden by child classes to explicitly set the table and key fields for a particular database table.

Paramètres:
string$tableName of the table to model.
string$keyName of the primary key field in the table.
JDatabase&$dbJDatabase connector object.
Depuis:
11.1

Références $db, $fields, $key, $name, JFactory\getConfig(), et null.

+ Voici le graphe d'appel pour cette fonction :


Documentation des fonctions membres

JTable::_getAssetName ( )
protected

Method to compute the default name of the asset. The default name is in the form table_name.id where id is the value of the primary key of the table.

Renvoie:
string
Depuis:
11.1

Réimplémentée dans JTableCategory, et JTableContent.

JTable::_getAssetParentId (   $table = null,
  $id = null 
)
protected

Method to get the parent asset under which to register this one. By default, all assets are registered to the ROOT node with ID, which will default to 1 if none exists. The extended class can define a table and id to lookup. If the asset does not exist it will be created.

Paramètres:
JTable$tableA JTable object for the asset parent.
integer$idId to look up
Renvoie:
integer
Depuis:
11.1

Réimplémentée dans JTableCategory, et JTableContent.

JTable::_getAssetTitle ( )
protected

Method to return the title to use for the asset table. In tracking the assets a title is kept for each asset so that there is some context available in a unified access manager. Usually this would just return $this->title or $this->name or whatever is being used for the primary name of the row. If this method is not overridden, the asset name is used.

Renvoie:
string The string to use as the title in the asset table.

11.1

Réimplémentée dans JTableCategory, et JTableContent.

JTable::_lock ( )
protected

Method to lock the database table for writing.

Renvoie:
boolean True on success.
Depuis:
11.1
Exceptions:
JDatabaseException
JTable::_unlock ( )
protected

Method to unlock the database table for writing.

Renvoie:
boolean True on success.
Depuis:
11.1
static JTable::addIncludePath (   $path = null)
static

Add a filesystem path where JTable should search for table class files. You may either pass a string or an array of paths.

Paramètres:
mixed$pathA filesystem path or array of filesystem paths to add.
Renvoie:
array An array of filesystem paths to find JTable classes in.

11.1

Références $path.

Référencé par JModel\addTablePath(), getInstance(), plgContentJoomla\onContentAfterSave(), plgUserContactCreator\onUserAfterSave(), InstallerModelManage\publish(), et BannersHelper\updateReset().

+ Voici le graphe des appelants de cette fonction :

JTable::bind (   $src,
  $ignore = array() 
)

Method to bind an associative array or object to the JTable instance.This method only binds properties that are publicly accessible and optionally takes an array of properties to ignore when binding.

Paramètres:
mixed$srcAn associative array or object to bind to the JTable instance.
mixed$ignoreAn optional array or space separated list of properties to ignore while binding.
Renvoie:
boolean True on success.

11.1

Réimplémentée dans JTableCategory, JTableUser, JTableContent, BannersTableBanner, JTableModule, JTableExtension, JTableUpdate, JTableMenu, FinderTableFilter, JTableViewlevel, ContactTableContact, WeblinksTableWeblink, NewsfeedsTableNewsfeed, et TemplatesTableStyle.

Références JText\sprintf().

+ Voici le graphe d'appel pour cette fonction :

JTable::canDelete (   $pk = null,
  $joins = null 
)

Generic check for whether dependencies exist for this object in the database schema

Can be overloaded/supplemented by the child class

Paramètres:
mixed$pkAn optional primary key value check the row for. If not set the instance property value is used.
array$joinsAn optional array to compiles standard joins formatted like: [label => 'Label', name => 'table name' , idfield => 'field', joinfield => 'field']
Renvoie:
boolean True on success.
Obsolète:
12.1 http://docs.joomla.org/JTable/canDelete
Depuis:
11.1

Références $i, $query, $row, JText\_(), JLog\add(), null, et JLog\WARNING.

+ Voici le graphe d'appel pour cette fonction :

JTable::check ( )

Method to perform sanity checks on the JTable instance properties to ensure they are safe to store in the database. Child classes should override this method to make sure the data they are storing in the database is safe and as expected before storage.

Renvoie:
boolean True if the instance is sane and able to be stored in the database.

11.1

Réimplémentée dans JTableNested, JTableUser, JTableContent, JTableCategory, JTableAsset, ContactTableContact, WeblinksTableWeblink, JTableMenu, FinderTableFilter, JTableViewlevel, NewsfeedsTableNewsfeed, TemplatesTableStyle, BannersTableBanner, JTableModule, JTableExtension, JTableUpdate, JTableMenuType, JTableLanguage, JTableUsergroup, RedirectTableLink, et MessagesTableMessage.

JTable::checkIn (   $pk = null)

Method to check a row in if the necessary properties/fields exist. Checking a row in will allow other users the ability to edit the row.

Paramètres:
mixed$pkAn optional primary key value to check out. If not set the instance property value is used.
Renvoie:
boolean True on success.

11.1

Références $query, JText\_(), null, et JText\sprintf().

+ Voici le graphe d'appel pour cette fonction :

JTable::checkOut (   $userId,
  $pk = null 
)

Method to check a row out if the necessary properties/fields exist. To prevent race conditions while editing rows in a database, a row can be checked out if the fields 'checked_out' and 'checked_out_time' are available. While a row is checked out, any attempt to store the row by a user other than the one who checked the row out should be held until the row is checked in again.

Paramètres:
integer$userIdThe Id of the user checking out the row.
mixed$pkAn optional primary key value to check out. If not set the instance property value is used.
Renvoie:
boolean True on success.

11.1

Références $query, $userId, JText\_(), JFactory\getDate(), null, et JText\sprintf().

+ Voici le graphe d'appel pour cette fonction :

JTable::delete (   $pk = null)

Method to delete a row from the database table by primary key value.

Paramètres:
mixed$pkAn optional primary key value to delete. If not set the instance property value is used.
Renvoie:
boolean True on success.

11.1

Réimplémentée dans JTableUser, JTableSession, JTableMenuType, JTableUsergroup, et TemplatesTableStyle.

Références $asset, $name, $query, JText\_(), getInstance(), null, et JText\sprintf().

+ Voici le graphe d'appel pour cette fonction :

JTable::getDbo ( )

Method to get the JDatabase connector object.

Renvoie:
JDatabase The internal database connector object.

11.1

JTable::getFields ( )

Get the columns from database table.

Renvoie:
mixed An array of the field names, or false if an error occurs.
Depuis:
11.1

Références $fields, $name, JText\_(), et null.

+ Voici le graphe d'appel pour cette fonction :

static JTable::getInstance (   $type,
  $prefix = 'JTable',
  $config = array() 
)
static

Static method to get an instance of a JTable class if it can be found in the table include paths. To add include paths for searching for JTable classes

Voir également:
JTable::addIncludePath().
Paramètres:
string$typeThe type (name) of the JTable class to get an instance of.
string$prefixAn optional prefix for the table class name.
array$configAn optional array of configuration values for the JTable object.
Renvoie:
mixed A JTable object if found or boolean false if one could not be found.

11.1

Références $config, $db, $path, $type, addIncludePath(), JPath\find(), JFactory\getDbo(), jimport(), JError\raiseWarning(), et JText\sprintf().

Référencé par JInstallerComponent\_buildAdminMenus(), JModel\_createTable(), InstallerModelLanguages\_getLanguageManifest(), JInstallerLanguage\_install(), JInstallerComponent\_removeAdminMenus(), JUpdaterExtension\_startElement(), JUpdaterCollection\_startElement(), NewsfeedsModelNewsfeed\batchCopy(), ContentModelArticle\batchCopy(), ContactModelContact\batchCopy(), BannersModelBanner\batchCopy(), JModelAdmin\batchCopy(), JModelAdmin\batchMove(), JAccess\check(), JAccess\checkGroup(), UsersModelProfile\checkin(), UsersModelProfile\checkout(), JTableMenuType\delete(), LanguagesModelLanguages\delete(), JTableNested\delete(), delete(), JInstallerLibrary\discover(), JInstallerTemplate\discover(), JInstallerLanguage\discover(), JInstallerModule\discover(), JInstallerPlugin\discover(), JInstallerComponent\discover(), JInstaller\discover_install(), JInstallerComponent\discover_install(), JElementArticle\fetchElement(), JElementContact\fetchElement(), JoomlaupdateModelDefault\finaliseUpgrade(), JUpdater\findUpdates(), InstallerModelDatabase\fixDefaultTextFilters(), InstallerModelDatabase\fixUpdateVersion(), JAccess\getAssetRules(), InstallerModelDatabase\getDefaultTextFilters(), JFormFieldUser\getInput(), WeblinksModelWeblink\getItem(), ContentModelArticles\getListQuery(), LanguagesModelLanguage\getTable(), ContentModelFeature\getTable(), UsersModelUser\getTable(), UsersModelGroup\getTable(), MenusModelMenu\getTable(), RedirectModelLink\getTable(), BannersModelClient\getTable(), WeblinksModelWeblink\getTable(), UsersModelNote\getTable(), MessagesModelMessage\getTable(), CategoriesModelCategory\getTable(), UsersModelLevel\getTable(), FinderModelFilter\getTable(), PluginsModelPlugin\getTable(), NewsfeedsModelNewsfeed\getTable(), BannersModelBanners\getTable(), FinderModelMaps\getTable(), ContentModelArticle\getTable(), FinderModelIndex\getTable(), TemplatesModelStyle\getTable(), ContactModelContact\getTable(), BannersModelBanner\getTable(), JUser\getTable(), ModulesModelModule\getTable(), MenusModelItem\getTable(), InstallerModelDatabase\getUpdateVersion(), JInstallerFile\install(), JInstallerLibrary\install(), JInstallerPackage\install(), JInstallerTemplate\install(), JInstallerPlugin\install(), JInstallerModule\install(), InstallerModelLanguages\install(), JInstallerComponent\install(), plgUserContactCreator\onUserAfterSave(), FinderIndexerHelper\prepareContent(), InstallerModelManage\publish(), BannersTableBanner\publish(), LanguagesModelInstalled\publish(), InstallerModelManage\refresh(), JInstaller\refreshManifestCache(), InstallerModelManage\remove(), UsersModelLevels\reorder(), ConfigModelApplication\save(), ConfigModelComponent\save(), TemplatesModelStyle\save(), UsersModelLevels\saveorder(), TemplatesModelStyle\setHome(), LanguagesModelLanguages\setPublished(), BannersTableBanner\stick(), ContactTableContact\store(), WeblinksTableWeblink\store(), JTableLanguage\store(), JTableMenuType\store(), NewsfeedsTableNewsfeed\store(), BannersTableBanner\store(), JTableMenu\store(), FinderTableFilter\store(), JTableCategory\store(), JTableContent\store(), store(), JInstallerLibrary\uninstall(), JInstallerTemplate\uninstall(), JInstallerPackage\uninstall(), JInstallerFile\uninstall(), JInstallerLanguage\uninstall(), JInstallerPlugin\uninstall(), JInstallerModule\uninstall(), JInstallerComponent\uninstall(), InstallerModelUpdate\update(), JUpdater\update(), JInstallerLanguage\update(), JInstallerComponent\update(), joomlaInstallerScript\updateManifestCaches(), et BannersHelper\updateReset().

+ Voici le graphe d'appel pour cette fonction :

JTable::getKeyName ( )

Method to get the primary key field name for the table.

Renvoie:
string The name of the primary key for the table.

11.1

JTable::getNextOrder (   $where = '')

Method to get the next ordering value for a group of rows defined by an SQL WHERE clause. This is useful for placing a new item last in a group of items in the table.

Paramètres:
string$whereWHERE clause to use for selecting the MAX(ordering) for the table.
Renvoie:
mixed Boolean false an failure or the next ordering value as an integer.

11.1

Références $query, et JText\sprintf().

+ Voici le graphe d'appel pour cette fonction :

JTable::getRules ( )

Method to get the rules for the record.

Renvoie:
JAccessRules object
Depuis:
11.1
JTable::getTableName ( )

Method to get the database table name for the class.

Renvoie:
string The name of the database table being modeled.
Depuis:
11.1

http://docs.joomla.org/JTable/getTableName

JTable::hit (   $pk = null)

Method to increment the hits for a row if the necessary property/field exists.

Paramètres:
mixed$pkAn optional primary key value to increment. If not set the instance property value is used.
Renvoie:
boolean True on success.

11.1

Références $query, null, et JText\sprintf().

+ Voici le graphe d'appel pour cette fonction :

JTable::isCheckedOut (   $with = 0,
  $against = null 
)

Method to determine if a row is checked out and therefore uneditable by a user. If the row is checked out by the same user, then it is considered not checked out – as the user can still edit it.

Paramètres:
integer$withThe userid to preform the match with, if an item is checked out by this user the function will return false.
integer$againstThe userid to perform the match against when the function is used as a static function.
Renvoie:
boolean True if checked out.

11.1 todo 8.

Références $db.

JTable::load (   $keys = null,
  $reset = true 
)

Method to load a row from the database by primary key and bind the fields to the JTable instance properties.

Paramètres:
mixed$keysAn optional primary key value to load the row by, or an array of fields to match. If not set the instance property value is used.
boolean$resetTrue to reset the default values before loading the new row.
Renvoie:
boolean True if successful. False if row not found or on error (internal error state set in that case).

11.1

Réimplémentée dans JTableUser.

Références $field, $fields, JError\$legacy, $query, $row, JText\_(), elseif, et JText\sprintf().

+ Voici le graphe d'appel pour cette fonction :

JTable::move (   $delta,
  $where = '' 
)

Method to move a row in the ordering sequence of a group of rows defined by an SQL WHERE clause. Negative numbers move the row up in the sequence and positive numbers move it down.

Paramètres:
integer$deltaThe direction and magnitude to move the row in the ordering sequence.
string$whereWHERE clause to use for limiting the selection of rows to compact the ordering values.
Renvoie:
mixed Boolean true on success.

11.1

Réimplémentée dans JTableNested.

Références $query, $row, elseif, null, et JText\sprintf().

+ Voici le graphe d'appel pour cette fonction :

JTable::publish (   $pks = null,
  $state = 1,
  $userId = 0 
)

Method to set the publishing state for a row or list of rows in the database table. The method respects checked out rows by other users and will attempt to checkin rows that it can after adjustments are made.

Paramètres:
mixed$pksAn optional array of primary key values to update. If not set the instance property value is used.
integer$stateThe publishing state. eg. [0 = unpublished, 1 = published]
integer$userIdThe user id of the user performing the operation.
Renvoie:
boolean True on success.

11.1

Réimplémentée dans JTableNested, JTableContent, BannersTableBanner, WeblinksTableWeblink, JTableExtension, FinderTableFilter, UsersTableNote, MessagesTableMessage, FinderTableMap, et BannersTableClient.

Références $query, $state, $userId, JText\_(), JText\sprintf(), et JArrayHelper\toInteger().

+ Voici le graphe d'appel pour cette fonction :

JTable::reorder (   $where = '')

Method to compact the ordering values of rows in a group of rows defined by an SQL WHERE clause.

Paramètres:
string$whereWHERE clause to use for limiting the selection of rows to compact the ordering values.
Renvoie:
mixed Boolean true on success.

11.1

Références $i, $query, $row, et JText\sprintf().

+ Voici le graphe d'appel pour cette fonction :

JTable::reset ( )

Method to reset class properties to the defaults set in the class definition. It will ignore the primary key as well as any private class properties.

Renvoie:
void

11.1

JTable::save (   $src,
  $orderingFilter = '',
  $ignore = '' 
)

Method to provide a shortcut to binding, checking and storing a JTable instance to the database table. The method will check a row in once the data has been stored and if an ordering filter is present will attempt to reorder the table rows based on the filter. The ordering filter is an instance property name. The rows that will be reordered are those whose value matches the JTable instance for the property specified.

Paramètres:
mixed$srcAn associative array or object to bind to the JTable instance.
string$orderingFilterFilter for the order updating
mixed$ignoreAn optional array or space separated list of properties to ignore while binding.
Renvoie:
boolean True on success.

11.1

JTable::setDBO ( $db)

Method to set the JDatabase connector object.

Paramètres:
object&$dbA JDatabase connector object to be used by the table object.
Renvoie:
boolean True on success.

11.1

Références $db.

JTable::setRules (   $input)

Method to set rules for the record.

Paramètres:
mixed$inputA JAccessRules object, JSON string, or array.
Renvoie:
void
Depuis:
11.1
JTable::store (   $updateNulls = false)

Method to store a row in the database from the JTable instance properties. If a primary key value is set the row with that primary key value will be updated with the instance property values. If no primary key value is set a new row will be inserted into the database with the properties from the JTable instance.

Paramètres:
boolean$updateNullsTrue to update fields even if they are null.
Renvoie:
boolean True on success.

11.1

Réimplémentée dans JTableNested, JTableUser, JTableContent, JTableCategory, FinderTableFilter, JTableMenu, JTableUsergroup, BannersTableBanner, NewsfeedsTableNewsfeed, JTableMenuType, RedirectTableLink, TemplatesTableStyle, JTableLanguage, ContactTableContact, WeblinksTableWeblink, et UsersTableNote.

Références $asset, $name, $query, $title, getInstance(), et JText\sprintf().

+ Voici le graphe d'appel pour cette fonction :

JTable::toXML (   $mapKeysToText = false)

Method to export the JTable instance properties to an XML string.

Paramètres:
boolean$mapKeysToTextTrue to map foreign keys to text values.
Renvoie:
string XML string representation of the instance.
Obsolète:
12.1 http://docs.joomla.org/JTable/toXML
Depuis:
11.1

Réimplémentée dans JTableContent.

Références JLog\add(), null, et JLog\WARNING.

+ Voici le graphe d'appel pour cette fonction :


Documentation des données membres

JTable::$_db
protected
JTable::$_locked = false
protected
JTable::$_rules
protected
JTable::$_tbl = ''
protected
JTable::$_tbl_key = ''
protected
JTable::$_trackAssets = false
protected

La documentation de cette classe a été générée à partir du fichier suivant :