|
| __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) |
|
Abstract Table class
Parent class to all tables.
- Depuis
- 1.7.0
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 | $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 |
- Depuis
- 1.7.0
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().
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 | $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. |
- Renvoie
- boolean True on success.
- Depuis
- 1.7.0
- Exceptions
-
Références $key, $query, $this, $userId, AbstractEvent\create(), elseif, Factory\getDate(), Joomla\CMS\Application\getDispatcher(), et null.
static getInstance |
( |
|
$type, |
|
|
|
$prefix = 'JTable' , |
|
|
|
$config = array() |
|
) |
| |
|
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().
- Paramètres
-
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. |
- Renvoie
- Table|boolean A Table object if found or boolean false on failure.
- Depuis
- 1.7.0
- Obsolète:
- 5.0 Use the MvcFactory instead
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().
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 | $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. |
- Renvoie
- boolean True if checked out.
- Depuis
- 1.7.0
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.
- Paramètres
-
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. |
- Renvoie
- boolean True if successful. False if row not found.
- Depuis
- 1.7.0
- Exceptions
-
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.
- Paramètres
-
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. |
- Renvoie
- boolean True on success.
- Depuis
- 1.7.0
- Exceptions
-
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.
- Paramètres
-
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. |
- Renvoie
- boolean True on success; false if $pks is empty.
- Depuis
- 1.7.0
Références $key, $nowDate, $query, $state, $this, $userId, Text\_(), AbstractEvent\create(), Factory\getDate(), et Joomla\CMS\Application\getDispatcher().