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 | |
addBehavior ($name, $config=array()) | |
__construct ($config=array()) | |
setIDsFromRequest () | |
setId ($id=0) | |
getId () | |
setIds ($idlist) | |
getIds () | |
reset () | |
clearState () | |
clearInput () | |
setInput ($input) | |
resetSavedState () | |
loadhistory ($version_id, FOFTable &$table, $alias) | |
& | getItem ($id=null) |
& | getList ($overrideLimits=false, $group='') |
& | getItemList ($overrideLimits=false, $group='') |
& | getIterator ($overrideLimits=false, $tableClass=null) |
& | getFirstItem ($overrideLimits=false) |
save ($data) | |
copy () | |
getSavedTable () | |
delete () | |
publish ($publish=1, $user=null) | |
checkout () | |
checkin () | |
isCheckedOut () | |
hit () | |
move ($dirn) | |
reorder () | |
getPagination () | |
getTotal () | |
getState ($key=null, $default=null, $filter_type='raw') | |
getHash () | |
getTable ($name='', $prefix=null, $options=array()) | |
getReorderWhere () | |
buildQuery ($overrideLimits=false) | |
getTableFields () | |
getTableAlias () | |
buildCountQuery () | |
& | getClone () |
__get ($name) | |
__set ($name, $value) | |
__call ($name, $arguments) | |
& | savestate ($newState) |
populateSavestate ($defaultSaveState=-999) | |
applyAccessFiltering ($userID=null) | |
getForm ($data=array(), $loadData=true, $source=null) | |
findFormFilename ($source, $paths=array()) | |
validateForm ($form, $data, $group=null) | |
onBeforeLoadForm (&$name, &$source, &$options) | |
onAfterLoadForm (FOFForm &$form, &$name, &$source, &$options) | |
onBeforePreprocessForm (FOFForm &$form, &$data) | |
onAfterPreprocessForm (FOFForm &$form, &$data) | |
getDbo () | |
getName () | |
setDbo ($db) | |
setState ($property, $value=null) | |
setBehaviorParam ($name, $value) | |
getBehaviorParam ($name, $default=null) | |
blacklistFilters ($list=null, $reset=false) | |
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 & | getAnInstance ($type, $prefix='', $config=array()) |
static & | getTmpInstance ($type, $prefix='', $config=array()) |
static | addIncludePath ($path='', $prefix='') |
static | addTablePath ($path) |
Fonctions membres protégées | |
_getListCount ($query) | |
_real_getState ($property=null, $default=null) | |
getUserStateFromRequest ($key, $request, $default=null, $type='none', $setUserState=true) | |
& | _getList ($query, $limitstart=0, $limit=0, $group='') |
& | _createTable ($name, $prefix='Table', $config=array()) |
populateState () | |
loadForm ($name, $source, $options=array(), $clear=false, $xpath=false) | |
loadFormData () | |
preprocessForm (FOFForm &$form, &$data, $group='content') | |
onProcessList (&$resultArray) | |
onAfterGetItem (&$record) | |
onBeforeSave (&$data, &$table) | |
onAfterSave (&$table) | |
onBeforeDelete (&$id, &$table) | |
onAfterDelete ($id) | |
onBeforeCopy (&$table) | |
onAfterCopy (&$table) | |
onBeforePublish (&$table) | |
onAfterPublish (&$table) | |
onBeforeHit (&$table) | |
onAfterHit (&$table) | |
onBeforeMove (&$table) | |
onAfterMove (&$table) | |
onBeforeReorder (&$table) | |
onAfterReorder (&$table) | |
cleanCache ($group=null, $client_id=0) | |
Fonctions membres protégées statiques | |
static | _createFileName ($type, $parts=array()) |
Attributs protégés | |
$__state_set = null | |
$_db | |
$event_after_delete = 'onContentAfterDelete' | |
$event_after_save = 'onContentAfterSave' | |
$event_before_delete = 'onContentBeforeDelete' | |
$event_before_save = 'onContentBeforeSave' | |
$event_change_state = 'onContentChangeState' | |
$event_clean_cache = null | |
$id_list = array() | |
$id = null | |
$input = array() | |
$list = null | |
$name | |
$option = null | |
$otable = null | |
$pagination = null | |
$record = null | |
$state | |
$table = null | |
$total = null | |
$_savestate = null | |
$_forms = array() | |
$_formData = array() | |
$configProvider = null | |
$modelDispatcher = null | |
$default_behaviors = array('filters') | |
$_behaviorParams = array() | |
Attributs protégés hérités de FOFUtilsObject | |
$_errors = array() | |
__construct | ( | $config = array() | ) |
Public class constructor
array | $config | The configuration array |
Références $behavior, $className, $component, $config, $id, $limit, $name, $path, $view, elseif, FOFPlatform\getInstance(), name, null, option, et FOFInflector\singularize().
__call | ( | $name, | |
$arguments | |||
) |
__get | ( | $name | ) |
Magic getter; allows to use the name of model state keys as properties
string | $name | The name of the variable to get |
Références $name.
__set | ( | $name, | |
$value | |||
) |
|
staticprotected |
|
protected |
Method to load and return a model object.
string | $name | The name of the view |
string | $prefix | The class prefix. Optional. |
array | $config | The configuration array to pass to the table |
Références $config, $name, $prefix, elseif, FOFTable\getAnInstance(), et null.
|
protected |
|
protected |
Returns a record count for the query
string | $query | The query. |
addBehavior | ( | $name, | |
$config = array() |
|||
) |
|
static |
Add a directory where FOFModel should search for models. You may either pass a string or an array of directories.
mixed | $path | A path or array[sting] of paths to search. |
string | $prefix | A prefix for models. |
Références $path, $prefix, et FOFPlatform\getInstance().
Référencé par FOFController\addModelPath().
|
static |
Adds to the stack of model table paths in LIFO order.
mixed | $path | The directory as a string or directories as an array to add. |
Références $path, et FOFTable\addIncludePath().
applyAccessFiltering | ( | $userID = null | ) |
Applies view access level filtering for the specified user. Useful to filter a front-end items listing.
integer | $userID | The user ID to use. Skip it to use the currently logged in user. |
Références $user, et FOFPlatform\getInstance().
Set or get the blacklisted filters
mixed | $list | A filter or list of filters to blacklist. If null return the list of blacklisted filter |
boolean | $reset | Reset the blacklist if true |
Références $list.
buildCountQuery | ( | ) |
Builds the count query used in getTotal()
buildQuery | ( | $overrideLimits = false | ) |
Builds the SELECT query
boolean | $overrideLimits | Are we requested to override the set limits? |
checkin | ( | ) |
Checks in the current item
checkout | ( | ) |
|
protected |
Clean the cache
string | $group | The cache group |
integer | $client_id | The ID of the client |
Références $options, FOFPlatform\getInstance(), et option.
clearInput | ( | ) |
Clears the input array.
clearState | ( | ) |
copy | ( | ) |
Copy one or more records
delete | ( | ) |
findFormFilename | ( | $source, | |
$paths = array() |
|||
) |
Guesses the best candidate for the path to use for a particular form.
string | $source | The name of the form file to load, without the .xml extension. |
array | $paths | The paths to look into. You can declare this to override the default FOF paths. |
Références $name, $option, $path, $suffix, $view, FOFPlatform\getInstance(), FOFInflector\pluralize(), et FOFInflector\singularize().
|
static |
Returns a new model object. Unless overridden by the $config array, it will try to automatically populate its state from the request variables.
string | $type | Model type, e.g. 'Items' |
string | $prefix | Model prefix, e.g. 'FoobarModel' |
array | $config | Model configuration variables |
Références $component, $config, $path, $prefix, $type, elseif, et FOFPlatform\getInstance().
Référencé par FOFController\createModel(), et FOFFormFieldRelation\getOptions().
getBehaviorParam | ( | $name, | |
$default = null |
|||
) |
& getClone | ( | ) |
Clones the model object and returns the clone
getDbo | ( | ) |
Method to get the database driver object
Référencé par FOFUtilsUpdate\removeObsoleteUpdateSites().
& getFirstItem | ( | $overrideLimits = false | ) |
A cross-breed between getItem and getItemList. It runs the complete query, like getItemList does. However, instead of returning an array of ad-hoc objects, it binds the data from the first item fetched on the list to an instance of the table object and returns that table object instead.
boolean | $overrideLimits | Should I override set limits? |
We have to clone the instance, or when multiple getFirstItem calls occur, we'll update EVERY instance created
Références $list.
A method for getting the form from the model.
array | $data | Data for the form. |
boolean | $loadData | True if the form is to load its own data (default case), false if not. |
boolean | $source | The name of the form. If not set we'll try the form_name state variable or fall back to default. |
getHash | ( | ) |
Returns a hash for this component and view, e.g. "foobar.items.", used for determining the keys of the variables which will be placed in the session storage.
Références $option, $view, et FOFInflector\pluralize().
getId | ( | ) |
Returns the currently set ID
Références $id.
Référencé par FOFRenderJoomla\renderFormEdit(), et FOFRenderStrapper\renderFormEdit().
getIds | ( | ) |
Returns the list of IDs for batch operations
& getItem | ( | $id = null | ) |
& getItemList | ( | $overrideLimits = false , |
|
$group = '' |
|||
) |
Returns a list of items
boolean | $overrideLimits | Should I override set limits? |
string | $group | The group by clause |
Références $limit, $list, et $query.
Référencé par FOFRenderStrapper\renderFormBrowse().
Returns a FOFDatabaseIterator over a list of items.
THERE BE DRAGONS. Unlike the getItemList() you have a few restrictions:
The getIterator() method is a great way to sift through a large amount of records which would otherwise not fit in memory since it only keeps one record in PHP memory at a time. It works best with simple models, returning all the contents of a single database table.
boolean | $overrideLimits | Should I ignore set limits? |
string | $tableClass | The table class for the iterator, e.g. FoobarTableBar. Leave empty to use the default Table class for this Model. |
Références $db, $limit, $name, $prefix, $query, FOFDatabaseIterator\getIterator(), null, option, et FOFInflector\singularize().
& getList | ( | $overrideLimits = false , |
|
$group = '' |
|||
) |
Alias for getItemList
boolean | $overrideLimits | Should I override set limits? |
string | $group | The group by clause |
getName | ( | ) |
Method to get the model name
The model name. By default parsed using the classname or it can be set by passing a $config['name'] in the class constructor
Exception |
Références $name, $r, name, et null.
Référencé par FOFRenderJoomla\renderFieldset(), et FOFRenderStrapper\renderFieldset().
getPagination | ( | ) |
Get a pagination object
Références $limit, $total, et JLoader\import().
Référencé par FOFRenderStrapper\renderFormBrowse().
getReorderWhere | ( | ) |
Creates the WHERE part of the reorder query
Get a filtered state variable
string | $key | The name of the state variable |
mixed | $default | The default value to use |
string | $filter_type | Filter type |
Références $default, $filter, $key, $value, et JLoader\import().
Référencé par FOFRenderStrapper\renderFormBrowse().
getTable | ( | $name = '' , |
|
$prefix = null , |
|||
$options = array() |
|||
) |
Method to get a table object, load it if necessary.
string | $name | The table name. Optional. |
string | $prefix | The class prefix. Optional. |
array | $options | Configuration array for model. Optional. |
Exception |
Références $name, $options, $prefix, FOFPlatform\getInstance(), null, option, et FOFInflector\singularize().
Référencé par FOFRenderStrapper\renderFormBrowse(), FOFRenderJoomla\renderFormEdit(), et FOFRenderStrapper\renderFormEdit().
getTableAlias | ( | ) |
Get the alias set for this model's table
getTableFields | ( | ) |
Returns a list of the fields of the table associated with this model
Références $fields.
|
static |
Returns a new instance of a model, with the state reset to defaults
string | $type | Model type, e.g. 'Items' |
string | $prefix | Model prefix, e.g. 'FoobarModel' |
array | $config | Model configuration variables |
Références $config, $prefix, $type, et elseif.
Référencé par CpanelViewCpanel\display(), FOFFormHeaderModel\getOptions(), FOFFormFieldRelation\getOptions(), et FOFFormFieldModel\getOptions().
|
protected |
Gets the value of a user state variable.
string | $key | The key of the user state variable. |
string | $request | The name of the variable passed in a request. |
string | $default | The default value for the variable if not found. Optional. |
string | $type | Filter for the variable, for valid values see JFilterInput::clean(). Optional. |
boolean | $setUserState | Should I save the variable in the user state? Default: true. Optional. |
Références $default, $key, $type, et FOFPlatform\getInstance().
hit | ( | ) |
Increments the hit counter
isCheckedOut | ( | ) |
Tells you if the current item is checked out or not
Method to get a form object.
string | $name | The name of the form. |
string | $source | The form filename (e.g. form.browse) |
array | $options | Optional array of options for the form creation. |
boolean | $clear | Optional argument to force load a new form. |
bool | string | $xpath | An optional xpath to search for the fields. |
@throws Exception
Références $data, $form, $hash, $name, $option, $options, $view, FOFForm\addFieldPath(), FOFForm\addFormPath(), FOFForm\addHeaderPath(), FOFForm\getInstance(), et FOFPlatform\getInstance().
|
protected |
Method to get the data that should be injected in the form.
loadhistory | ( | $version_id, | |
FOFTable & | $table, | ||
$alias | |||
) |
Method to load a row for editing from the version history table.
integer | $version_id | Key to the version history table. |
FOFTable | &$table | Content table object being loaded. |
string | $alias | The type_alias in #__content_types |
Références $key, $user, FOFTable\bind(), JArrayHelper\fromObject(), et FOFTable\getKeyName().
move | ( | $dirn | ) |
Moves the current item up or down in the ordering list
string | $dirn | The direction and magnitude to use (2 means move up by 2 positions, -3 means move down three positions) |
Références $id.
|
protected |
|
protected |
This method runs after a record with key value $id is deleted
integer | $id | The id of the record which was deleted |
Références $context, $name, $self, FOFPlatform\getInstance(), et option.
|
protected |
|
protected |
onAfterLoadForm | ( | FOFForm & | $form, |
& | $name, | ||
& | $source, | ||
& | $options | ||
) |
|
protected |
onAfterPreprocessForm | ( | FOFForm & | $form, |
& | $data | ||
) |
|
protected |
|
protected |
|
protected |
This method runs after the data is saved to the $table.
FOFTable | &$table | The table which was saved |
Références $name, $self, FOFPlatform\getInstance(), et option.
|
protected |
|
protected |
|
protected |
onBeforeLoadForm | ( | & | $name, |
& | $source, | ||
& | $options | ||
) |
Allows the manipulation before the form is loaded
string | &$name | The name of the form. |
string | &$source | The form source. Can be XML string if file flag is set to false. |
array | &$options | Optional array of options for the form creation. |
|
protected |
onBeforePreprocessForm | ( | FOFForm & | $form, |
& | $data | ||
) |
|
protected |
|
protected |
|
protected |
This method runs before the $data is saved to the $table. Return false to stop saving.
array | &$data | The data to save |
FOFTable | &$table | The table to save the data to |
Références $data, $key, $name, $self, FOFPlatform\getInstance(), et option.
|
protected |
This method can be overridden to automatically do something with the list results array. You are supposed to modify the list which was passed in the parameters; DO NOT return a new array!
array | &$resultArray | An array of objects, each row representing a record |
populateSavestate | ( | $defaultSaveState = -999 | ) |
Initialises the _savestate variable
integer | $defaultSaveState | The default value for the savestate |
|
protected |
Method to auto-populate the model state.
This method should only be called once per instantiation and is designed to be called on the first call to the getState() method unless the model configuration flag to ignore the request is set.
Method to allow derived classes to preprocess the form.
FOFForm | $form | A FOFForm object. |
mixed | &$data | The data expected for the form. |
string | $group | The name of the plugin group to import (defaults to "content"). |
Exception | if there is an error in the form event. |
Références $data, $dispatcher, $form, $results, FOFUtilsObservableDispatcher\getInstance(), et FOFPlatform\getInstance().
publish | ( | $publish = 1 , |
|
$user = null |
|||
) |
Toggles the published state of one or several items
integer | $publish | The publishing state to set (e.g. 0 is unpublished) |
integer | $user | The user ID performing this action |
Références $context, $name, $user, FOFPlatform\getInstance(), et option.
reorder | ( | ) |
Reorders all items in the table
save | ( | $data | ) |
& savestate | ( | $newState | ) |
setBehaviorParam | ( | $name, | |
$value | |||
) |
setDbo | ( | $db | ) |
Method to set the database driver object
FOFDatabaseDriver | $db | A FOFDatabaseDriver based object |
Références $db.
setId | ( | $id = 0 | ) |
Sets the ID and resets internal data
integer | $id | The ID to use |
InvalidArgumentException |
Références $id, et FOFPlatform\getInstance().
setIds | ( | $idlist | ) |
setInput | ( | $input | ) |
setState | ( | $property, | |
$value = null |
|||
) |
Method to set model state variables
string | $property | The name of the property. |
mixed | $value | The value of the property to set or null. |
Références $value.
validateForm | ( | $form, | |
$data, | |||
$group = null |
|||
) |
Method to validate the form data.
FOFForm | $form | The form to validate against. |
array | $data | The data to validate. |
string | $group | The name of the field group to validate. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |