Joomla CMS
3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
|
Fonctions membres publiques | |
__construct ($table, $key, &$db, $config=array()) | |
setKnownFields ($fields, $initialise=false) | |
getKnownFields () | |
hasField ($fieldName) | |
addKnownField ($field, $initialise=false) | |
removeKnownField ($field) | |
addBehavior ($name, $config=array()) | |
setTriggerEvents ($newState=false) | |
getTriggerEvents () | |
hasTags () | |
setHasTags ($newState=false) | |
setTablePrefix ($prefix) | |
setSkipChecks ($skip) | |
load ($keys=null, $reset=true) | |
check () | |
reset () | |
getClone () | |
canDelete ($oid=null, $joins=null) | |
bind ($src, $ignore=array()) | |
store ($updateNulls=false) | |
move ($delta, $where='') | |
reorder ($where='') | |
checkout ($userId, $oid=null) | |
checkin ($oid=null) | |
isCheckedOut ($with=0, $unused_against=null) | |
copy ($cid=null) | |
publish ($cid=null, $publish=1, $user_id=0) | |
delete ($oid=null) | |
hit ($oid=null, $log=false) | |
toCSV ($separator=',') | |
getData () | |
getCSVHeader ($separator=',') | |
getTableFields ($tableName=null) | |
getTableAlias () | |
setTableAlias ($string) | |
getColumnAlias ($column) | |
setColumnAlias ($column, $columnAlias) | |
getQueryJoin ($asReference=false) | |
setQueryJoin ($query) | |
setInput (FOFInput $input) | |
getFields () | |
getAssetName () | |
getAssetKey () | |
getAssetTitle () | |
getAssetParentId ($table=null, $id=null) | |
setAssetKey ($assetKey) | |
getTableName () | |
getKeyName () | |
getId () | |
getDbo () | |
setDBO ($db) | |
setRules ($input) | |
getRules () | |
isAssetsTracked () | |
setAssetsTracked ($state) | |
save ($src, $orderingFilter='', $ignore='') | |
getNextOrder ($where='') | |
setConfig (array $config) | |
getContentType () | |
getRelations () | |
getConfigProvider () | |
getConfigProviderKey () | |
checkContentType ($alias=null) | |
Fonctions membres publiques hérités de FOFUtilsObject | |
__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 & | getAnInstance ($type=null, $prefix='JTable', $config=array()) |
static | forceInstance ($key=null, $instance=null) |
static | addIncludePath ($path=null) |
Fonctions membres protégées | |
getQueryJoinFields () | |
normalizeSelectFields ($fields) | |
isQuoted ($column) | |
onBeforeBind (&$from) | |
onAfterLoad (&$result) | |
onBeforeStore ($updateNulls) | |
onAfterBind (&$src) | |
onAfterStore () | |
onBeforeMove ($updateNulls) | |
onAfterMove () | |
onBeforeReorder ($where='') | |
onAfterReorder () | |
onBeforeDelete ($oid) | |
onAfterDelete ($oid) | |
onBeforeHit ($oid, $log) | |
onAfterHit ($oid) | |
onBeforeCopy ($oid) | |
onAfterCopy ($oid) | |
onBeforePublish (&$cid, $publish) | |
onAfterReset () | |
onBeforeReset () | |
getAsset () | |
_lock () | |
_unlock () | |
getUcmCoreAlias ($alias, $null="null") | |
Attributs protégés | |
$config = array() | |
$_tbl = '' | |
$_tbl_key = '' | |
$_db | |
$_trackAssets = false | |
$_has_tags = false | |
$_rules | |
$_locked = false | |
$_trigger_events = false | |
$_tableAlias = false | |
$_columnAlias = array() | |
$_autoChecks = false | |
$_skipChecks = array() | |
$_tableExists = true | |
$_assetKey = '' | |
$input = null | |
$_queryJoin = null | |
$_tablePrefix = '' | |
$knownFields = array() | |
$configProvider = null | |
$tableDispatcher = null | |
$default_behaviors = array('tags', 'assets') | |
$_relations = null | |
$_configProviderKey = '' | |
$contentType = null | |
Attributs protégés hérités de FOFUtilsObject | |
$_errors = array() | |
Attributs protégés statiques | |
static | $instances = array() |
static | $_includePaths = array() |
static | $tableFieldCache = array() |
static | $tableCache = array() |
__construct | ( | $table, | |
$key, | |||
& | $db, | ||
$config = array() |
|||
) |
Class Constructor.
string | $table | Name of the database table to model. |
string | $key | Name of the primary key field in the table. |
FOFDatabaseDriver | &$db | Database driver |
array | $config | The configuration parameters array |
Références $behavior, $component, $config, $db, $default_behaviors, $fields, $key, $type, addBehavior(), elseif, getColumnAlias(), FOFPlatform\getInstance(), getKnownFields(), getQueryJoinFields(), getTableFields(), JLoader\import(), null, reset(), setKnownFields(), et FOFInflector\singularize().
|
protected |
Method to lock the database table for writing.
RuntimeException |
|
protected |
Method to unlock the database table for writing.
Référencé par store().
addBehavior | ( | $name, | |
$config = array() |
|||
) |
Adds a behavior to the table
string | $name | The name of the behavior |
array | $config | Optional Behavior configuration |
Références $behavior, $config, et $name.
Référencé par __construct().
|
static |
Add a filesystem path where FOFTable 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. |
Référencé par FOFModel\addTablePath().
addKnownField | ( | $field, | |
$initialise = false |
|||
) |
bind | ( | $src, | |
$ignore = array() |
|||
) |
Method to bind an associative array or object to the FOFTable 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 FOFTable instance. |
mixed | $ignore | An optional array or space separated list of properties to ignore while binding. |
InvalidArgumentException |
Références getKnownFields(), onAfterBind(), et onBeforeBind().
Référencé par load(), FOFModel\loadhistory(), et store().
Generic check for whether dependencies exist for this object in the db schema
integer | $oid | The primary key of the record to delete |
array | $joins | Any joins to foreign table, used to determine if dependent records exist |
Références $_db, $_tbl_key, $db, $i, $key, $oid, $option, $prefix, $query, et FOFUtilsObject\setError().
check | ( | ) |
Based on fields properties (nullable column), checks if the field is required or not
Références $_tbl_key, $field, $fields, $text, getColumnAlias(), getKnownFields(), getTableFields(), getTableName(), et FOFUtilsObject\setError().
checkContentType | ( | $alias = null | ) |
Check if a UCM content type exists for this resource, and create it if it does not
string | $alias | The content type alias (optional) |
checkin | ( | $oid = null | ) |
Check in (unlock) a record
integer | $oid | The primary key value of the record to unlock |
Références $_tbl_key, $oid, $query, getColumnAlias(), getKnownFields(), et null.
Référencé par publish().
checkout | ( | $userId, | |
$oid = null |
|||
) |
Check out (lock) a record
integer | $userId | The locking user's ID |
integer | $oid | The primary key value of the record to lock |
Références $_tbl_key, $date, $oid, $query, $userId, getColumnAlias(), FOFPlatform\getInstance(), getKnownFields(), et null.
copy | ( | $cid = null | ) |
Copy (duplicate) one or more records
integer | array | $cid | The primary key value (or values) or the record(s) to copy |
Références $_tbl_key, $item, getColumnAlias(), getKnownFields(), isCheckedOut(), load(), null, onAfterCopy(), onBeforeCopy(), reset(), FOFUtilsObject\setError(), store(), et FOFUtilsArray\toInteger().
delete | ( | $oid = null | ) |
Delete a record
integer | $oid | The primary key value of the item to delete |
UnexpectedValueException |
Références $_tbl_key, $oid, $query, load(), onAfterDelete(), et onBeforeDelete().
Force an instance inside class cache. Setting arguments to null nukes all or part of the cache
string | null | $key | TableClass to replace. Set it to null to nuke the entire cache |
FOFTable | null | $instance | Instance to replace. Set it to null to nuke $key instances |
|
static |
Returns a static object instance of a particular table type
string | $type | The table name |
string | $prefix | The prefix of the table class |
array | $config | Optional configuration variables |
Références $component, $config, $configProvider, $option, $path, $prefix, $type, elseif, FOFPlatform\getInstance(), null, FOFInflector\pluralize(), et FOFInflector\singularize().
Référencé par FOFModel\_createTable().
|
protected |
Loads the asset table related to this table. This will help tests, too, since we can mock this function.
getAssetKey | ( | ) |
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.
UnexpectedValueException |
getAssetName | ( | ) |
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.
UnexpectedValueException |
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.
getAssetTitle | ( | ) |
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.
getClone | ( | ) |
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 Joomla functions.
string | $column | Name of the "special" column (ie ordering, hits etc etc) |
Référencé par __construct(), check(), checkin(), checkout(), copy(), hasField(), hit(), isCheckedOut(), move(), publish(), et reorder().
getConfigProvider | ( | ) |
Gets a reference to the configuration parameters provider for this table
Référencé par FOFTableRelations\__construct().
getConfigProviderKey | ( | ) |
Returns the configuration parameters provider's key for this table
Référencé par FOFTableRelations\__construct().
getContentType | ( | ) |
Get the content type for ucm
When tags was first introduced contentType variable didn't exist - so we guess one This will fail if content history behvaiour is enabled. This code is deprecated and will be removed in FOF 3.0 in favour of the content type class variable
getCSVHeader | ( | $separator = ',' | ) |
Get the header for exporting item list to CSV
string | $separator | CSV separator. Tip: use "\t" to get a TSV file instead. |
Références $separator, et getKnownFields().
getData | ( | ) |
getDbo | ( | ) |
Method to get the FOFDatabaseDriver object.
getFields | ( | ) |
Get the columns from database table.
getId | ( | ) |
|
static |
Returns a static object instance of a particular table type
string | $type | The table name |
string | $prefix | The prefix of the table class |
array | $config | Optional configuration variables |
Références $config, $prefix, et $type.
Référencé par FOFDatabaseIterator\__construct(), FOFTableRelations\getIteratorFromRelation(), FOFFormFieldRelation\getOptions(), et FOFTableRelations\getTableFromRelation().
getKeyName | ( | ) |
Method to get the primary key field name for the table.
Référencé par FOFTableRelations\__construct(), getClone(), et FOFModel\loadhistory().
getKnownFields | ( | ) |
Get the known fields array
Références $knownFields.
Référencé par FOFTableRelations\__construct(), __construct(), bind(), check(), checkin(), checkout(), copy(), getCSVHeader(), getData(), hit(), load(), move(), publish(), reorder(), store(), et toCSV().
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. |
getQueryJoin | ( | $asReference = false | ) |
Get a JOIN query, used to join other tables
boolean | $asReference | Return an object reference instead of a copy |
Référencé par load().
|
protected |
Extracts the fields from the join query
Référencé par __construct(), et reset().
getRelations | ( | ) |
Returns the table relations object of the current table, lazy-loading it if necessary
getRules | ( | ) |
Method to get the rules for the record.
getTableAlias | ( | ) |
getTableFields | ( | $tableName = null | ) |
Get the columns from a database table.
string | $tableName | Table name. If null current table is used |
Références $_tbl, $field, $fields, $name, $prefix, $tableCache, elseif, FOFPlatform\getInstance(), json_encode, et null.
Référencé par __construct(), check(), reset(), et store().
getTableName | ( | ) |
Method to get the database table name for the class.
Référencé par FOFTableRelations\__construct(), et check().
getTriggerEvents | ( | ) |
|
protected |
Utility methods that fetches the column name for the field. If it does not exists, returns a "null" string
string | $alias | The alias for the column |
string | $null | What to return if no column exists |
hasField | ( | $fieldName | ) |
Does the specified field exist?
string | $fieldName | The field name to search (it's OK to use aliases) |
Références getColumnAlias().
hasTags | ( | ) |
Register a hit on a record
integer | $oid | The primary key value of the record |
boolean | $log | Should I log the hit? |
Références $_tbl_key, $oid, $query, getColumnAlias(), getKnownFields(), onAfterHit(), et onBeforeHit().
isAssetsTracked | ( | ) |
Method to check if the record is treated as an ACL asset
isCheckedOut | ( | $with = 0 , |
|
$unused_against = null |
|||
) |
Is a record locked?
integer | $with | The userid to preform the match with. If an item is checked out by this user the function will return false. |
integer | $unused_against | Junk inherited from JTable; ignore |
UnexpectedValueException |
Références $_tbl_key, getColumnAlias(), et null.
Référencé par copy().
|
protected |
Is the field quoted?
string | $column | Column field |
Method to load a row from the database by primary key and bind the fields to the FOFTable 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. |
RuntimeException | |
UnexpectedValueException |
Références $_tbl_key, $field, $fields, $query, $row, $value, bind(), elseif, getKnownFields(), getQueryJoin(), null, onAfterLoad(), et reset().
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. |
UnexpectedValueException |
Références $_tbl_key, $query, $row, elseif, getColumnAlias(), getKnownFields(), null, onAfterMove(), et onBeforeMove().
|
protected |
Normalizes the fields, returning an associative array with all the fields. Ie array('foobar as foo, bar') becomes array('foobar' => 'foo', 'bar' => 'bar')
array | $fields | Array with column fields |
|
protected |
The event which runs after binding data to the class
object | array | &$src | The data to bind |
Référencé par bind().
|
protected |
The even which runs after copying a record
integer | $oid | The PK value of the record which was copied (not the new one) |
Référencé par copy().
|
protected |
The event which runs after deleting a record
integer | $oid | The PK value of the record which was deleted |
Référencé par delete().
|
protected |
The event which runs after hitting a record
integer | $oid | The PK value of the record which was hit |
Référencé par hit().
|
protected |
The event which runs after loading a record from the database
boolean | &$result | Did the load succeeded? |
Référencé par load().
|
protected |
The event which runs after moving a record
Référencé par move().
|
protected |
The event which runs after reordering a table
Référencé par reorder().
|
protected |
The event which runs after the object is reset to its default values.
Référencé par reset().
|
protected |
The event which runs after storing (saving) data to the database
Référencé par store().
|
protected |
The event which runs before binding data to the table
NOTE TO 3RD PARTY DEVELOPERS:
When you override the following methods in your child classes, be sure to call parent::method AFTER your code, otherwise the plugin events do NOT get triggered
Example: protected function onBeforeBind(){ // Your code here return parent::onBeforeBind() && $your_result; }
Do not do it the other way around, e.g. return $your_result && parent::onBeforeBind() Due to PHP short-circuit boolean evaluation the parent::onBeforeBind() will not be called if $your_result is false.
object | array | &$from | The data to bind |
Référencé par bind().
|
protected |
The even which runs before copying a record
integer | $oid | The PK value of the record being copied |
Référencé par copy().
|
protected |
The event which runs before deleting a record
integer | $oid | The PK value of the record to delete |
Référencé par delete().
|
protected |
The event which runs before hitting a record
integer | $oid | The PK value of the record to hit |
boolean | $log | Should we log the hit? |
Référencé par hit().
|
protected |
The event which runs before moving a record
boolean | $updateNulls | Should nulls be saved as nulls (true) or just skipped over (false)? |
Référencé par move().
|
protected |
The event which runs before a record is (un)published
integer | array | &$cid | The PK IDs of the records being (un)published |
integer | $publish | 1 to publish, 0 to unpublish |
Référencé par publish().
|
protected |
The event which runs before reordering a table
string | $where | The WHERE clause of the SQL query to run on reordering (record filter) |
Référencé par reorder().
|
protected |
The even which runs before the object is reset to its default values.
Référencé par reset().
|
protected |
The event which runs before storing (saving) data to the database
boolean | $updateNulls | Should nulls be saved as nulls (true) or just skipped over (false)? |
Référencé par store().
publish | ( | $cid = null , |
|
$publish = 1 , |
|||
$user_id = 0 |
|||
) |
Publish or unpublish records
integer | array | $cid | The primary key value(s) of the item(s) to publish/unpublish |
integer | $publish | 1 to publish an item, 0 to unpublish |
integer | $user_id | The user ID of the user (un)publishing the item. |
Références $_tbl_key, $query, checkin(), getColumnAlias(), getKnownFields(), onBeforePublish(), FOFUtilsObject\setError(), et FOFUtilsArray\toInteger().
removeKnownField | ( | $field | ) |
Remove a field from the known fields array
string | $field | The name of the field to remove |
Références $field.
reorder | ( | $where = '' | ) |
Change the ordering of the records of the table
string | $where | The WHERE clause of the SQL used to fetch the order |
UnexpectedValueException |
Références $_tbl_key, $i, $query, $row, $rows, getColumnAlias(), getKnownFields(), onAfterReorder(), et onBeforeReorder().
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.
Références $fields, getQueryJoinFields(), getTableFields(), onAfterReset(), et onBeforeReset().
Référencé par __construct(), copy(), et load().
save | ( | $src, | |
$orderingFilter = '' , |
|||
$ignore = '' |
|||
) |
Method to provide a shortcut to binding, checking and storing a FOFTable 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 FOFTable instance for the property specified.
mixed | $src | An associative array or object to bind to the FOFTable instance. |
string | $orderingFilter | Filter for the order updating |
mixed | $ignore | An optional array or space separated list of properties to ignore while binding. |
setAssetKey | ( | $assetKey | ) |
This method sets the asset key for the items of this table. Obviously, it is only meant to be used when you have a table with an asset field.
string | $assetKey | The name of the asset key to use |
setAssetsTracked | ( | $state | ) |
Method to manually set this record as ACL asset or not. We have to do this since the automatic check is made in the constructor, but here we can't set any alias. So, even if you have an alias for asset_id
, it wouldn't be reconized and assets won't be tracked.
$state |
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) |
setConfig | ( | array | $config | ) |
setDBO | ( | $db | ) |
Method to set the FOFDatabaseDriver object.
FOFDatabaseDriver | $db | A FOFDatabaseDriver object to be used by the table object. |
setHasTags | ( | $newState = false | ) |
setInput | ( | FOFInput | $input | ) |
setKnownFields | ( | $fields, | |
$initialise = false |
|||
) |
Replace the entire known fields array
array | $fields | A simple array of known field names |
boolean | $initialise | Should we initialise variables to null? |
Références $field, $fields, et null.
Référencé par __construct().
setQueryJoin | ( | $query | ) |
Sets the query with joins to other tables
FOFDatabaseQuery | $query | The JOIN query to use |
setRules | ( | $input | ) |
Method to set rules for the record.
mixed | $input | A JAccessRules object, JSON string, or array. |
setSkipChecks | ( | $skip | ) |
Sets fields to be skipped from automatic checks.
array/string | $skip Fields to be skipped by automatic checks |
setTableAlias | ( | $string | ) |
setTablePrefix | ( | $prefix | ) |
setTriggerEvents | ( | $newState = false | ) |
Sets the events trigger switch state
boolean | $newState | The new state of the switch (what else could it be?) |
Références true.
store | ( | $updateNulls = false | ) |
Method to store a row in the database from the FOFTable 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 FOFTable instance.
boolean | $updateNulls | True to update fields even if they are null. |
While the documentation for update/insertObject and execute() say they return a boolean, not all of the implemtnations. Depending on the version of J! and the specific driver, they may return a database object, or boolean, or a mix, or toss an exception. So try/catch, and test for false.
Références $_tbl_key, $fields, $key, _unlock(), bind(), getKnownFields(), getTableFields(), null, onAfterStore(), onBeforeStore(), et FOFUtilsObject\setError().
Référencé par copy().
toCSV | ( | $separator = ',' | ) |
Export the item as a CSV line
string | $separator | CSV separator. Tip: use "\t" to get a TSV file instead. |
Références $separator, et getKnownFields().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Référencé par canDelete().
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Référencé par getTableFields().
|
protected |
Référencé par canDelete(), check(), checkin(), checkout(), copy(), delete(), hit(), isCheckedOut(), load(), move(), publish(), reorder(), et store().
|
protected |
|
protected |
Référencé par getTriggerEvents().
|
protected |
Référencé par __construct(), addBehavior(), getAnInstance(), et getInstance().
|
protected |
Référencé par getAnInstance().
|
protected |
|
protected |
Référencé par __construct().
|
protected |
|
staticprotected |
|
protected |
Référencé par getKnownFields().
|
staticprotected |
Référencé par getTableFields().
|
protected |
|
staticprotected |