![]() |
Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques | |
__construct ($table, $key, DatabaseDriver $db, DispatcherInterface $dispatcher=null) | |
getFields ($reload=false) | |
appendPrimaryKeys ($query, $pk=null) | |
getTableName () | |
getKeyName ($multiple=false) | |
getId () | |
getDbo () | |
setDbo (DatabaseDriver $db) | |
setRules ($input) | |
getRules () | |
reset () | |
bind ($src, $ignore=array()) | |
load ($keys=null, $reset=true) | |
check () | |
save ($src, $orderingFilter='', $ignore='') | |
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) | |
getColumnAlias ($column) | |
setColumnAlias ($column, $columnAlias) | |
hasField ($key) | |
![]() | |
__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) | |
![]() | |
delete ($pk=null) | |
getKeyName () | |
store ($updateNulls=false) | |
![]() | |
setDispatcher (DispatcherInterface $dispatcher) | |
Fonctions membres publiques statiques | |
static | getInstance ($type, $prefix='JTable', $config=array()) |
static | addIncludePath ($path=null) |
Champs de données | |
$typeAlias = null | |
Fonctions membres protégées | |
_getAssetName () | |
_getAssetTitle () | |
_lock () | |
_unlock () | |
Attributs protégés | |
$_tbl = '' | |
$_tbl_key = '' | |
$_tbl_keys = array() | |
$_db | |
$_trackAssets = false | |
$_rules | |
$_locked = false | |
$_autoincrement = true | |
$_columnAlias = array() | |
$_jsonEncode = array() | |
$_supportNullValue = false | |
![]() | |
$_errors = array() | |
Attributs privés statiques | |
static | $_includePaths = array() |
static | $tableFields |
__construct | ( | $table, | |
$key, | |||
DatabaseDriver | $db, | ||
DispatcherInterface | $dispatcher = null |
||
) |
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. |
DatabaseDriver | $db | DatabaseDriver object. |
DispatcherInterface | $dispatcher | Event dispatcher for this table |
Références $db, $fields, $key, $name, $this, Symfony\Contracts\Service\__construct(), AbstractEvent\create(), elseif, Factory\getApplication(), Joomla\CMS\Application\getDispatcher(), null, et Joomla\Event\setDispatcher().
|
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.
|
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.
|
protected |
Method to lock the database table for writing.
|
protected |
Method to unlock the database table for writing.
|
static |
Add a filesystem path where Table should search for table class files.
array | string | $path | A filesystem path or array of filesystem paths to add. |
Références $dir, $path, et __DIR__.
Référencé par AjaxController\fetchAssociations(), et HistoryModel\getSha1Hash().
appendPrimaryKeys | ( | $query, | |
$pk = null |
|||
) |
Method to append the primary keys for this table to a query.
DatabaseQuery | $query | A query object to append. |
mixed | $pk | Optional primary key parameter. |
Références $query.
bind | ( | $src, | |
$ignore = array() |
|||
) |
Method to bind an associative array or object to the Table instance.This method only binds properties that are publicly accessible and optionally takes an array of properties to ignore when binding.
array | object | $src | An associative array or object to bind to the Table instance. |
array | string | $ignore | An optional array or space separated list of properties to ignore while binding. |
Implémente TableInterface.
Références $field, $this, AbstractEvent\create(), et Joomla\CMS\Application\getDispatcher().
check | ( | ) |
Method to perform sanity checks on the Table 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.
Implémente TableInterface.
Références $this, AbstractEvent\create(), et Joomla\CMS\Application\getDispatcher().
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. |
Références $key, $query, $this, AbstractEvent\create(), elseif, Factory\getApplication(), Joomla\CMS\Application\getDispatcher(), et null.
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. |
Références $key, $query, $this, $userId, AbstractEvent\create(), elseif, Factory\getDate(), Joomla\CMS\Application\getDispatcher(), et null.
getColumnAlias | ( | $column | ) |
Method to return the real name of a "special" column such as ordering, hits, published etc etc. In this way you are free to follow your db naming convention and use the built in functions.
string | $column | Name of the "special" column (ie ordering, hits) |
Références $return.
getDbo | ( | ) |
Method to get the DatabaseDriver object.
Implémente TableInterface.
getFields | ( | $reload = false | ) |
getId | ( | ) |
Returns the identity (primary key) value of this record
Implémente TableInterface.
Références $key.
|
static |
Static method to get an instance of a Table class if it can be found in the table include paths.
To add include paths for searching for Table classes see Table::addIncludePath().
string | $type | The type (name) of the Table 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 Table object. |
Références $config, $db, $prefix, $type, Path\find(), Factory\getContainer(), Factory\getDbo(), et Symfony\Contracts\Service\has().
Référencé par UCMContent\__construct(), InstallerAdapter\__construct(), Installer\__construct(), Language\_getAssetParentId(), MenuType\_getAssetParentId(), ExtensionAdapter\_startElement(), CollectionAdapter\_startElement(), InstallerAdapter\canUninstallPackageChild(), CssMenu\check(), AdminModel\checkCategoryId(), LibraryAdapter\checkExtensionInFilesystem(), LanguageAdapter\createContentLanguage(), LegacyFactory\createTable(), CoreContent\delete(), MenuType\delete(), LanguagesModel\delete(), ModuleAdapter\discover(), LibraryAdapter\discover(), PluginAdapter\discover(), TemplateAdapter\discover(), LanguageAdapter\discover(), ComponentAdapter\discover(), AjaxController\fetchAssociations(), FileAdapter\finaliseInstall(), ModuleAdapter\finaliseInstall(), LanguageAdapter\finaliseUninstall(), FileAdapter\finaliseUninstall(), LibraryAdapter\finaliseUninstall(), TemplateAdapter\finaliseUninstall(), PackageAdapter\finaliseUninstall(), ComponentAdapter\finaliseUninstall(), AssociationsHelper\getItem(), LanguagesModel\getLanguageManifest(), ContactsModel\getListQuery(), AssociationsModel\getListQuery(), ArticlesModel\getListQuery(), LanguageModel\getTable(), GroupModel\getTable(), UserModel\getTable(), MenuModel\getTable(), PreviewModel\getTable(), LevelModel\getTable(), CompareModel\getTable(), PluginModel\getTable(), HistoryModel\getTable(), User\getTable(), ModuleModel\getTable(), ArticleModel\hit(), CategoryModel\hit(), LanguagesModel\install(), TagsHelper\postStoreProcess(), Helper\prepareContent(), ContenthistoryHelper\prepareData(), InstalledModel\publish(), LevelsModel\reorder(), ComponentModel\save(), ApplicationModel\save(), StyleModel\save(), LevelsModel\saveorder(), LanguagesModel\setDefault(), StyleModel\setHome(), LanguagesModel\setPublished(), Language\store(), UCMBase\store(), ContentType\store(), ContentHistory\store(), ContactTable\store(), Versioning\store(), MenuType\store(), NewsfeedTable\store(), Menu\store(), UCMContent\store(), Category\store(), Content\store(), LanguageAdapter\update(), updatecachetime_postinstall_action(), et CategoriesHelper\validateCategoryId().
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). |
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. |
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. |
Références $key.
getRules | ( | ) |
Method to get the rules for the record.
getTableName | ( | ) |
Method to get the database table name for the class.
hasField | ( | $key | ) |
Check if the record has a property (applying a column alias if it exists)
string | $key | key to be checked |
Implémente TableInterface.
hasPrimaryKey | ( | ) |
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. |
Références $key, $query, $this, AbstractEvent\create(), elseif, Joomla\CMS\Application\getDispatcher(), hits, et null.
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 user ID to perform the match with, if an item is checked out by this user the function will return false. |
integer | $against | The user ID to perform the match against when the function is used as a static function. |
Références $db, $query, $this, Factory\getApplication(), et Factory\getDbo().
Method to load a row from the database by primary key and bind the fields to the Table 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. |
Implémente TableInterface.
Références $field, $fields, $key, $query, $result, $this, $value, AbstractEvent\create(), elseif, et Joomla\CMS\Application\getDispatcher().
Référencé par JoomlaInstallerScript\contactItems(), et JoomlaInstallerScript\finderItems().
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éférences $query, $this, AbstractEvent\create(), elseif, Joomla\CMS\Application\getDispatcher(), et null.
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éférences $key, $nowDate, $query, $state, $this, $userId, Text\_(), AbstractEvent\create(), Factory\getDate(), et Joomla\CMS\Application\getDispatcher().
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. |
Références $i, $key, $query, $this, AbstractEvent\create(), et Joomla\CMS\Application\getDispatcher().
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).
Implémente TableInterface.
Références $this, AbstractEvent\create(), et Joomla\CMS\Application\getDispatcher().
save | ( | $src, | |
$orderingFilter = '' , |
|||
$ignore = '' |
|||
) |
Method to provide a shortcut to binding, checking and storing a Table 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 Table instance for the property specified.
array | object | $src | An associative array or object to bind to the Table instance. |
string | $orderingFilter | Filter for the order updating |
array | string | $ignore | An optional array or space separated list of properties to ignore while binding. |
setColumnAlias | ( | $column, | |
$columnAlias | |||
) |
Method to register a column alias for a "special" column.
string | $column | The "special" column (ie ordering) |
string | $columnAlias | The real column name (ie foo_ordering) |
setDbo | ( | DatabaseDriver | $db | ) |
Method to set the DatabaseDriver object.
DatabaseDriver | $db | A DatabaseDriver object to be used by the table object. |
Références $db.
setRules | ( | $input | ) |
Method to set rules for the record.
mixed | $input | A Rules object, JSON string, or array. |
Références $input.
|
protected |
|
protected |
|
protected |
|
staticprivate |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprivate |
$typeAlias = null |