Joomla Platform
13.1
Documentation des API du framework Joomla Platform
|
Fonctions membres publiques | |
__construct ($table, $key, JDatabaseDriver $db) | |
attachObserver (JObserverInterface $observer) | |
getObserverOfClass ($observerClass) | |
getFields () | |
appendPrimaryKeys ($query, $pk=null) | |
getTableName () | |
getKeyName ($multiple=false) | |
getDbo () | |
setDBO (JDatabaseDriver $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) | |
hasPrimaryKey () | |
hit ($pk=null) | |
isCheckedOut ($with=0, $against=null) | |
getNextOrder ($where= '') | |
getPrimaryKey (array $keys=array()) | |
reorder ($where= '') | |
move ($delta, $where= '') | |
publish ($pks=null, $state=1, $userId=0) | |
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) |
Fonctions membres publiques statiques | |
static | getInstance ($type, $prefix= 'JTable', $config=array()) |
static | addIncludePath ($path=null) |
Fonctions membres protégées | |
_getAssetName () | |
_getAssetTitle () | |
_getAssetParentId (JTable $table=null, $id=null) | |
_lock () | |
_unlock () |
Attributs protégés | |
$_tbl = '' | |
$_tbl_key = '' | |
$_tbl_keys = array() | |
$_db | |
$_trackAssets = false | |
$_rules | |
$_locked = false | |
$_autoincrement = true | |
$_observers | |
Attributs protégés inherited from JObject | |
$_errors = array() |
Attributs privés statiques | |
static | $_includePaths = array() |
JTable::__construct | ( | $table, | |
$key, | |||
JDatabaseDriver | $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.
string | $table | Name of the table to model. |
mixed | $key | Name of the primary key field in the table or array of field names that compose the primary key. |
JDatabaseDriver | $db | JDatabaseDriver object. |
Définition à la ligne 118 du fichier table.php.
Références JFactory\getConfig().
|
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.
Réimplémentée dans JTableContent, JTableCategory, et JTableModule.
Définition à la ligne 348 du fichier table.php.
|
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.
Réimplémentée dans JTableContent, JTableCategory, et JTableModule.
Définition à la ligne 391 du fichier table.php.
|
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.
Réimplémentée dans JTableContent, JTableCategory, et JTableModule.
|
protected |
|
protected |
|
static |
Add a filesystem path where JTable should search for table class files. You may either pass a string or an array of paths.
mixed | $path | A filesystem path or array of filesystem paths to add. |
Définition à la ligne 308 du fichier table.php.
Référencé par JModelLegacy\addTablePath().
JTable::appendPrimaryKeys | ( | $query, | |
$pk = null |
|||
) |
Method to append the primary keys for this table to a query.
JDatabaseQuery | $query | A query object to append. |
mixed | $pk | Optional primary key parameter. |
Définition à la ligne 415 du fichier table.php.
JTable::attachObserver | ( | JObserverInterface | $observer | ) |
Implement JObservableInterface: Adds an observer to this instance. This method will be called fron the constructor of classes implementing JObserverInterface which is instanciated by the constructor of $this with JObserverMapper::attachAllObservers($this)
JObserverInterface | JTableObserver | $observer | The observer object |
Implémente JObservableInterface.
Définition à la ligne 194 du fichier table.php.
Référencé par JTableObserver\__construct().
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.
mixed | $src | An associative array or object to bind to the JTable instance. |
mixed | $ignore | An optional array or space separated list of properties to ignore while binding. |
Réimplémentée dans JTableCategory, JTableModule, JTableContent, JTableUser, JTableExtension, JTableUpdate, JTableMenu, et JTableViewlevel.
Définition à la ligne 587 du fichier table.php.
Référencé par JModelLegacy\loadHistory().
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.
Réimplémentée dans JTableNested, JTableContent, JTableUser, JTableCategory, JTableModule, JTableAsset, JTableMenu, JTableViewlevel, JTableExtension, JTableUpdate, JTableMenuType, JTableLanguage, et JTableUsergroup.
Définition à la ligne 735 du fichier table.php.
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.
mixed | $pk | An optional primary key value to check out. If not set the instance property value is used. |
Définition à la ligne 1081 du fichier table.php.
Référencé par JModelLegacy\loadHistory().
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.
integer | $userId | The Id of the user checking out the row. |
mixed | $pk | An optional primary key value to check out. If not set the instance property value is used. |
Définition à la ligne 1018 du fichier table.php.
Références JFactory\getDate().
JTable::delete | ( | $pk = null | ) |
Method to delete a row from the database table by primary key value.
mixed | $pk | An optional primary key value to delete. If not set the instance property value is used. |
Réimplémentée dans JTableUser, JTableSession, JTableMenuType, et JTableUsergroup.
Définition à la ligne 930 du fichier table.php.
JTable::getDbo | ( | ) |
Method to get the JDatabaseDriver object.
JTable::getFields | ( | ) |
Get the columns from database table.
UnexpectedValueException |
Définition à la ligne 221 du fichier table.php.
|
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 see JTable::addIncludePath().
string | $type | The type (name) of the JTable class to get an instance of. |
string | $prefix | An optional prefix for the table class name. |
array | $config | An optional array of configuration values for the JTable object. |
Définition à la ligne 256 du fichier table.php.
Références JLog\add(), JPath\find(), JFactory\getDbo(), JText\sprintf(), et JLog\WARNING.
Référencé par JModelLegacy\_createTable(), JUpdaterExtension\_startElement(), JUpdaterCollection\_startElement(), JAccess\check(), JModelAdmin\checkCategoryId(), JAccess\checkGroup(), JTableMenuType\delete(), JTableNested\delete(), JUpdater\findUpdates(), JAccess\getAssetRules(), JUser\getTable(), JModelLegacy\loadHistory(), JTableLanguage\store(), JTableMenuType\store(), JTableMenu\store(), JTableCategory\store(), JTableContent\store(), et JUpdater\update().
JTable::getKeyName | ( | $multiple = false | ) |
Method to get the primary key field name for the table.
boolean | $multiple | True to return all primary keys (as an array) or false to return just the first one (as a string). |
Définition à la ligne 464 du fichier table.php.
Référencé par JModelLegacy\loadHistory().
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.
string | $where | WHERE clause to use for selecting the MAX(ordering) for the table. |
Définition à la ligne 1278 du fichier table.php.
JTable::getObserverOfClass | ( | $observerClass | ) |
JTable::getPrimaryKey | ( | array | $keys = array() | ) |
Get the primary key values for this table using passed in values as a default.
array | $keys | Optional primary key values to use. |
Définition à la ligne 1312 du fichier table.php.
JTable::getRules | ( | ) |
JTable::getTableName | ( | ) |
Method to get the database table name for the class.
JTable::hasPrimaryKey | ( | ) |
Validate that the primary key has been set.
Définition à la ligne 1138 du fichier table.php.
JTable::hit | ( | $pk = null | ) |
Method to increment the hits for a row if the necessary property/field exists.
mixed | $pk | An optional primary key value to increment. If not set the instance property value is used. |
Définition à la ligne 1183 du fichier table.php.
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.
integer | $with | The userid to preform the match with, if an item is checked out by this user the function will return false. |
integer | $against | The userid to perform the match against when the function is used as a static function. |
Définition à la ligne 1244 du fichier table.php.
Références JFactory\getDbo().
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.
mixed | $keys | An 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 | $reset | True to reset the default values before loading the new row. |
11.1 InvalidArgumentException RuntimeException UnexpectedValueException
Réimplémentée dans JTableUser.
Définition à la ligne 639 du fichier table.php.
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.
integer | $delta | The direction and magnitude to move the row in the ordering sequence. |
string | $where | WHERE clause to use for limiting the selection of rows to compact the ordering values. |
Réimplémentée dans JTableNested.
Définition à la ligne 1403 du fichier table.php.
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.
mixed | $pks | An optional array of primary key values to update. If not set the instance property value is used. |
integer | $state | The publishing state. eg. [0 = unpublished, 1 = published] |
integer | $userId | The user id of the user performing the operation. |
Réimplémentée dans JTableNested, JTableContent, et JTableExtension.
Définition à la ligne 1499 du fichier table.php.
JTable::reorder | ( | $where = '' | ) |
Method to compact the ordering values of rows in a group of rows defined by an SQL WHERE clause.
string | $where | WHERE clause to use for limiting the selection of rows to compact the ordering values. |
Définition à la ligne 1340 du fichier table.php.
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 (except $_errors).
Définition à la ligne 557 du fichier table.php.
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.
mixed | $src | An associative array or object to bind to the JTable instance. |
string | $orderingFilter | Filter for the order updating |
mixed | $ignore | An optional array or space separated list of properties to ignore while binding. |
Définition à la ligne 880 du fichier table.php.
JTable::setDBO | ( | JDatabaseDriver | $db | ) |
Method to set the JDatabaseDriver object.
JDatabaseDriver | $db | A JDatabaseDriver object to be used by the table object. |
Définition à la ligne 507 du fichier table.php.
JTable::setRules | ( | $input | ) |
Method to set rules for the record.
mixed | $input | A JAccessRules object, JSON string, or array. |
Définition à la ligne 523 du fichier table.php.
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.
boolean | $updateNulls | True to update fields even if they are null. |
Réimplémentée dans JTableNested, JTableUser, JTableContent, JTableCategory, JTableMenu, JTableUsergroup, JTableMenuType, et JTableLanguage.
Définition à la ligne 754 du fichier table.php.