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é
Référence de la classe FOFModel
+ Graphe d'héritage de FOFModel:

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()
 

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $config = array())

Public class constructor

Paramètres
array$configThe configuration array

Références $behavior, $className, $component, $config, $id, $limit, $name, $path, $view, elseif, FOFPlatform\getInstance(), name, null, option, et FOFInflector\singularize().

Documentation des fonctions membres

◆ __call()

__call (   $name,
  $arguments 
)

Magic caller; allows to use the name of model state keys as methods to set their values.

Paramètres
string$nameThe name of the state variable to set
mixed$argumentsThe value to set the state variable to
Renvoie
FOFModel Reference to self

Références $name.

◆ __get()

__get (   $name)

Magic getter; allows to use the name of model state keys as properties

Paramètres
string$nameThe name of the variable to get
Renvoie
mixed The value of the variable

Références $name.

◆ __set()

__set (   $name,
  $value 
)

Magic setter; allows to use the name of model state keys as properties

Paramètres
string$nameThe name of the variable
mixed$valueThe value to set the variable to
Renvoie
void

Références $name, et $value.

◆ _createFileName()

static _createFileName (   $type,
  $parts = array() 
)
staticprotected

Create the filename for a resource

Paramètres
string$typeThe resource type to create the filename for.
array$partsAn associative array of filename information.
Renvoie
string The filename
Depuis
12.2

Références $parts, et $type.

◆ _createTable()

& _createTable (   $name,
  $prefix = 'Table',
  $config = array() 
)
protected

Method to load and return a model object.

Paramètres
string$nameThe name of the view
string$prefixThe class prefix. Optional.
array$configThe configuration array to pass to the table
Renvoie
FOFTable Table object or boolean false if failed

Références $config, $name, $prefix, elseif, FOFTable\getAnInstance(), et null.

◆ _getList()

& _getList (   $query,
  $limitstart = 0,
  $limit = 0,
  $group = '' 
)
protected

Returns an object list

Paramètres
string$queryThe query
integer$limitstartOffset from start
integer$limitThe number of records
string$groupThe group by clause
Renvoie
array Array of objects

Références $limit, et $query.

◆ _getListCount()

_getListCount (   $query)
protected

Returns a record count for the query

Paramètres
string$queryThe query.
Renvoie
integer Number of rows for query
Depuis
12.2

◆ _real_getState()

_real_getState (   $property = null,
  $default = null 
)
protected

Method to get model state variables

Paramètres
string$propertyOptional parameter name
mixed$defaultOptional default value
Renvoie
object The property where specified, the state object where omitted
Depuis
12.2

Références $default, et null.

◆ addBehavior()

addBehavior (   $name,
  $config = array() 
)

Adds a behavior to the model

Paramètres
string$nameThe name of the behavior
array$configOptional Behavior configuration
Renvoie
boolean True if the behavior is found and added

Références $behavior, $config, $name, name, option, et FOFInflector\pluralize().

◆ addIncludePath()

static addIncludePath (   $path = '',
  $prefix = '' 
)
static

Add a directory where FOFModel should search for models. You may either pass a string or an array of directories.

Paramètres
mixed$pathA path or array[sting] of paths to search.
string$prefixA prefix for models.
Renvoie
array An array with directory elements. If prefix is equal to '', all directories are returned.
Depuis
12.2

Références $path, $prefix, et FOFPlatform\getInstance().

Référencé par FOFController\addModelPath().

◆ addTablePath()

static addTablePath (   $path)
static

Adds to the stack of model table paths in LIFO order.

Paramètres
mixed$pathThe directory as a string or directories as an array to add.
Renvoie
void
Depuis
12.2

Références $path, et FOFTable\addIncludePath().

◆ applyAccessFiltering()

applyAccessFiltering (   $userID = null)

Applies view access level filtering for the specified user. Useful to filter a front-end items listing.

Paramètres
integer$userIDThe user ID to use. Skip it to use the currently logged in user.
Renvoie
FOFModel Reference to self

Références $user, et FOFPlatform\getInstance().

◆ blacklistFilters()

blacklistFilters (   $list = null,
  $reset = false 
)

Set or get the blacklisted filters

Paramètres
mixed$listA filter or list of filters to blacklist. If null return the list of blacklisted filter
boolean$resetReset the blacklist if true
Renvoie
void|array Return an array of value if $list is null

Références $list.

◆ buildCountQuery()

buildCountQuery ( )

Builds the count query used in getTotal()

Renvoie
boolean

◆ buildQuery()

buildQuery (   $overrideLimits = false)

Builds the SELECT query

Paramètres
boolean$overrideLimitsAre we requested to override the set limits?
Renvoie
FOFDatabaseQuery

Références $db, $query, $self, et null.

◆ checkin()

checkin ( )

Checks in the current item

Renvoie
boolean

◆ checkout()

checkout ( )

Checks out the current item

Renvoie
boolean

Références FOFPlatform\getInstance().

◆ cleanCache()

cleanCache (   $group = null,
  $client_id = 0 
)
protected

Clean the cache

Paramètres
string$groupThe cache group
integer$client_idThe ID of the client
Renvoie
void

Références $options, FOFPlatform\getInstance(), et option.

◆ clearInput()

clearInput ( )

Clears the input array.

Renvoie
FOFModel

◆ clearState()

clearState ( )

Clears the model state, but doesn't touch the internal lists of records, record tables or record id variables. To clear these values, please use reset().

Renvoie
FOFModel

◆ copy()

copy ( )

Copy one or more records

Renvoie
boolean True on success

◆ delete()

delete ( )

Deletes one or several items

Renvoie
boolean True on success

Références $id.

◆ findFormFilename()

findFormFilename (   $source,
  $paths = array() 
)

Guesses the best candidate for the path to use for a particular form.

Paramètres
string$sourceThe name of the form file to load, without the .xml extension.
array$pathsThe paths to look into. You can declare this to override the default FOF paths.
Renvoie
mixed A string if the path and filename of the form to load is found, false otherwise.
Depuis
2.0

Références $name, $option, $path, $suffix, $view, FOFPlatform\getInstance(), FOFInflector\pluralize(), et FOFInflector\singularize().

◆ getAnInstance()

static& getAnInstance (   $type,
  $prefix = '',
  $config = array() 
)
static

Returns a new model object. Unless overridden by the $config array, it will try to automatically populate its state from the request variables.

Paramètres
string$typeModel type, e.g. 'Items'
string$prefixModel prefix, e.g. 'FoobarModel'
array$configModel configuration variables
Renvoie
FOFModel

Références $component, $config, $path, $prefix, $type, elseif, et FOFPlatform\getInstance().

Référencé par FOFController\createModel(), et FOFFormFieldRelation\getOptions().

◆ getBehaviorParam()

getBehaviorParam (   $name,
  $default = null 
)

Get a behavior param

Paramètres
string$nameThe name of the param
mixed$defaultThe default value returned if not set
Renvoie
mixed

Références $default, et $name.

◆ getClone()

& getClone ( )

Clones the model object and returns the clone

Renvoie
FOFModel

◆ getDbo()

getDbo ( )

Method to get the database driver object

Renvoie
FOFDatabaseDriver

Référencé par FOFUtilsUpdate\removeObsoleteUpdateSites().

◆ getFirstItem()

& 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.

Paramètres
boolean$overrideLimitsShould I override set limits?
Renvoie
FOFTable

We have to clone the instance, or when multiple getFirstItem calls occur, we'll update EVERY instance created

Références $list.

◆ getForm()

getForm (   $data = array(),
  $loadData = true,
  $source = null 
)

A method for getting the form from the model.

Paramètres
array$dataData for the form.
boolean$loadDataTrue if the form is to load its own data (default case), false if not.
boolean$sourceThe name of the form. If not set we'll try the form_name state variable or fall back to default.
Renvoie
mixed A FOFForm object on success, false on failure
Depuis
2.0

Références $data, $form, $name, $options, name, et null.

◆ getHash()

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.

Renvoie
string The hash

Références $option, $view, et FOFInflector\pluralize().

◆ getId()

getId ( )

Returns the currently set ID

Renvoie
integer

Références $id.

Référencé par FOFRenderJoomla\renderFormEdit(), et FOFRenderStrapper\renderFormEdit().

◆ getIds()

getIds ( )

Returns the list of IDs for batch operations

Renvoie
array An array of integers

◆ getItem()

& getItem (   $id = null)

Returns a single item. It uses the id set with setId, or the first ID in the list of IDs for batch operations

Paramètres
integer$idForce a primary key ID to the model. Use null to use the id from the state.
Renvoie
FOFTable A copy of the item's FOFTable array

Références $data, $id, et null.

◆ getItemList()

& getItemList (   $overrideLimits = false,
  $group = '' 
)

Returns a list of items

Paramètres
boolean$overrideLimitsShould I override set limits?
string$groupThe group by clause
Renvoie
array

Références $limit, $list, et $query.

Référencé par FOFRenderStrapper\renderFormBrowse().

◆ getIterator()

& getIterator (   $overrideLimits = false,
  $tableClass = null 
)

Returns a FOFDatabaseIterator over a list of items.

THERE BE DRAGONS. Unlike the getItemList() you have a few restrictions:

  • The onProcessList event does not run when you get an iterator
  • The Iterator returns FOFTable instances. By default, $this->table is used. If you have JOINs, GROUPs or a complex query in general you will need to create a custom FOFTable subclass and pass its type in $tableType.

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.

Paramètres
boolean$overrideLimitsShould I ignore set limits?
string$tableClassThe table class for the iterator, e.g. FoobarTableBar. Leave empty to use the default Table class for this Model.
Renvoie
FOFDatabaseIterator

Références $db, $limit, $name, $prefix, $query, FOFDatabaseIterator\getIterator(), null, option, et FOFInflector\singularize().

◆ getList()

& getList (   $overrideLimits = false,
  $group = '' 
)

Alias for getItemList

Paramètres
boolean$overrideLimitsShould I override set limits?
string$groupThe group by clause
Renvoie
array

◆ getName()

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

Renvoie
string The name of the model
Exceptions
Exception

Références $name, $r, name, et null.

Référencé par FOFRenderJoomla\renderFieldset(), et FOFRenderStrapper\renderFieldset().

◆ getPagination()

getPagination ( )

Get a pagination object

Renvoie
JPagination

Références $limit, $total, et JLoader\import().

Référencé par FOFRenderStrapper\renderFormBrowse().

◆ getReorderWhere()

getReorderWhere ( )

Creates the WHERE part of the reorder query

Renvoie
string

◆ getSavedTable()

getSavedTable ( )

Returns the table object after the last save() operation

Renvoie
FOFTable

◆ getState()

getState (   $key = null,
  $default = null,
  $filter_type = 'raw' 
)

Get a filtered state variable

Paramètres
string$keyThe name of the state variable
mixed$defaultThe default value to use
string$filter_typeFilter type
Renvoie
mixed The variable's value

Références $default, $filter, $key, $value, et JLoader\import().

Référencé par FOFRenderStrapper\renderFormBrowse().

◆ getTable()

getTable (   $name = '',
  $prefix = null,
  $options = array() 
)

Method to get a table object, load it if necessary.

Paramètres
string$nameThe table name. Optional.
string$prefixThe class prefix. Optional.
array$optionsConfiguration array for model. Optional.
Exceptions
Exception
Renvoie
FOFTable A FOFTable object

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()

getTableAlias ( )

Get the alias set for this model's table

Renvoie
string The table alias

◆ getTableFields()

getTableFields ( )

Returns a list of the fields of the table associated with this model

Renvoie
array

Références $fields.

◆ getTmpInstance()

static& getTmpInstance (   $type,
  $prefix = '',
  $config = array() 
)
static

Returns a new instance of a model, with the state reset to defaults

Paramètres
string$typeModel type, e.g. 'Items'
string$prefixModel prefix, e.g. 'FoobarModel'
array$configModel configuration variables
Renvoie
FOFModel

Références $config, $prefix, $type, et elseif.

Référencé par CpanelViewCpanel\display(), FOFFormHeaderModel\getOptions(), FOFFormFieldRelation\getOptions(), et FOFFormFieldModel\getOptions().

◆ getTotal()

getTotal ( )

Get the number of all items

Renvoie
integer

Références $query, et $total.

◆ getUserStateFromRequest()

getUserStateFromRequest (   $key,
  $request,
  $default = null,
  $type = 'none',
  $setUserState = true 
)
protected

Gets the value of a user state variable.

Paramètres
string$keyThe key of the user state variable.
string$requestThe name of the variable passed in a request.
string$defaultThe default value for the variable if not found. Optional.
string$typeFilter for the variable, for valid values see JFilterInput::clean(). Optional.
boolean$setUserStateShould I save the variable in the user state? Default: true. Optional.
Renvoie
string The request user state.

Références $default, $key, $type, et FOFPlatform\getInstance().

◆ hit()

hit ( )

Increments the hit counter

Renvoie
boolean

◆ isCheckedOut()

isCheckedOut ( )

Tells you if the current item is checked out or not

Renvoie
boolean

◆ loadForm()

loadForm (   $name,
  $source,
  $options = array(),
  $clear = false,
  $xpath = false 
)
protected

Method to get a form object.

Paramètres
string$nameThe name of the form.
string$sourceThe form filename (e.g. form.browse)
array$optionsOptional array of options for the form creation.
boolean$clearOptional argument to force load a new form.
bool | string$xpathAn optional xpath to search for the fields.
Renvoie
mixed FOFForm object on success, False on error.
@throws  Exception
Voir également
FOFForm
Depuis
2.0

Références $data, $form, $hash, $name, $option, $options, $view, FOFForm\addFieldPath(), FOFForm\addFormPath(), FOFForm\addHeaderPath(), FOFForm\getInstance(), et FOFPlatform\getInstance().

◆ loadFormData()

loadFormData ( )
protected

Method to get the data that should be injected in the form.

Renvoie
array The default data is an empty array.
Depuis
2.0

◆ loadhistory()

loadhistory (   $version_id,
FOFTable $table,
  $alias 
)

Method to load a row for editing from the version history table.

Paramètres
integer$version_idKey to the version history table.
FOFTable&$tableContent table object being loaded.
string$aliasThe type_alias in #__content_types
Renvoie
boolean False on failure or error, true otherwise.
Depuis
2.3

Références $key, $user, FOFTable\bind(), JArrayHelper\fromObject(), et FOFTable\getKeyName().

◆ move()

move (   $dirn)

Moves the current item up or down in the ordering list

Paramètres
string$dirnThe direction and magnitude to use (2 means move up by 2 positions, -3 means move down three positions)
Renvoie
boolean True on success

Références $id.

◆ onAfterCopy()

onAfterCopy ( $table)
protected

This method runs after a record has been copied

Paramètres
FOFTable&$tableThe table instance of the record which was copied
Renvoie
boolean True to allow the copy

Références $self.

◆ onAfterDelete()

onAfterDelete (   $id)
protected

This method runs after a record with key value $id is deleted

Paramètres
integer$idThe id of the record which was deleted
Renvoie
boolean Return false to raise an error, true otherwise

Références $context, $name, $self, FOFPlatform\getInstance(), et option.

◆ onAfterGetItem()

onAfterGetItem ( $record)
protected

This method runs after an item has been gotten from the database in a read operation. You can modify it before it's returned to the MVC triad for further processing.

Paramètres
FOFTable&$recordThe table instance we fetched
Renvoie
void

Références $self.

◆ onAfterHit()

onAfterHit ( $table)
protected

This method runs after a record has been hit

Paramètres
FOFTable&$tableThe table instance of the record which was hit
Renvoie
boolean True to allow the operation

Références $self.

◆ onAfterLoadForm()

onAfterLoadForm ( FOFForm $form,
$name,
$source,
$options 
)

Allows the manipulation after the form is loaded

Paramètres
FOFForm$formA FOFForm object.
string&$nameThe name of the form.
string&$sourceThe form source. Can be XML string if file flag is set to false.
array&$optionsOptional array of options for the form creation.
Renvoie
void

◆ onAfterMove()

onAfterMove ( $table)
protected

This method runs after a record has been moved

Paramètres
FOFTable&$tableThe table instance of the record which was moved
Renvoie
boolean True to allow the operation

Références $self.

◆ onAfterPreprocessForm()

onAfterPreprocessForm ( FOFForm $form,
$data 
)

Allows data and form manipulation after preprocessing the form

Paramètres
FOFForm$formA FOFForm object.
array&$dataThe data expected for the form.
Renvoie
void

◆ onAfterPublish()

onAfterPublish ( $table)
protected

This method runs after a record has been published

Paramètres
FOFTable&$tableThe table instance of the record which was published
Renvoie
boolean True to allow the operation

Références $self.

◆ onAfterReorder()

onAfterReorder ( $table)
protected

This method runs after a table is reordered

Paramètres
FOFTable&$tableThe table instance which was reordered
Renvoie
boolean True to allow the operation

Références $self.

◆ onAfterSave()

onAfterSave ( $table)
protected

This method runs after the data is saved to the $table.

Paramètres
FOFTable&$tableThe table which was saved
Renvoie
boolean

Références $name, $self, FOFPlatform\getInstance(), et option.

◆ onBeforeCopy()

onBeforeCopy ( $table)
protected

This method runs before a record is copied

Paramètres
FOFTable&$tableThe table instance of the record being copied
Renvoie
boolean True to allow the copy

Références $self.

◆ onBeforeDelete()

onBeforeDelete ( $id,
$table 
)
protected

This method runs before the record with key value of $id is deleted from $table

Paramètres
integer&$idThe ID of the record being deleted
FOFTable&$tableThe table instance used to delete the record
Renvoie
boolean

Références $context, $id, $name, $self, FOFPlatform\getInstance(), et option.

◆ onBeforeHit()

onBeforeHit ( $table)
protected

This method runs before a record is hit

Paramètres
FOFTable&$tableThe table instance of the record being hit
Renvoie
boolean True to allow the operation

Références $self.

◆ onBeforeLoadForm()

onBeforeLoadForm ( $name,
$source,
$options 
)

Allows the manipulation before the form is loaded

Paramètres
string&$nameThe name of the form.
string&$sourceThe form source. Can be XML string if file flag is set to false.
array&$optionsOptional array of options for the form creation.
Renvoie
void

◆ onBeforeMove()

onBeforeMove ( $table)
protected

This method runs before a record is moved

Paramètres
FOFTable&$tableThe table instance of the record being moved
Renvoie
boolean True to allow the operation

Références $self.

◆ onBeforePreprocessForm()

onBeforePreprocessForm ( FOFForm $form,
$data 
)

Allows data and form manipulation before preprocessing the form

Paramètres
FOFForm$formA FOFForm object.
array&$dataThe data expected for the form.
Renvoie
void

◆ onBeforePublish()

onBeforePublish ( $table)
protected

This method runs before a record is published

Paramètres
FOFTable&$tableThe table instance of the record being published
Renvoie
boolean True to allow the operation

Références $self.

◆ onBeforeReorder()

onBeforeReorder ( $table)
protected

This method runs before a table is reordered

Paramètres
FOFTable&$tableThe table instance being reordered
Renvoie
boolean True to allow the operation

Références $self.

◆ onBeforeSave()

onBeforeSave ( $data,
$table 
)
protected

This method runs before the $data is saved to the $table. Return false to stop saving.

Paramètres
array&$dataThe data to save
FOFTable&$tableThe table to save the data to
Renvoie
boolean Return false to prevent saving, true to allow it

Références $data, $key, $name, $self, FOFPlatform\getInstance(), et option.

◆ onProcessList()

onProcessList ( $resultArray)
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!

Paramètres
array&$resultArrayAn array of objects, each row representing a record
Renvoie
void

◆ populateSavestate()

populateSavestate (   $defaultSaveState = -999)

Initialises the _savestate variable

Paramètres
integer$defaultSaveStateThe default value for the savestate
Renvoie
void

◆ populateState()

populateState ( )
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.

Renvoie
void
Note
Calling getState in this method will result in recursion.
Depuis
12.2

◆ preprocessForm()

preprocessForm ( FOFForm $form,
$data,
  $group = 'content' 
)
protected

Method to allow derived classes to preprocess the form.

Paramètres
FOFForm$formA FOFForm object.
mixed&$dataThe data expected for the form.
string$groupThe name of the plugin group to import (defaults to "content").
Renvoie
void
Voir également
FOFFormField
Depuis
2.0
Exceptions
Exceptionif there is an error in the form event.

Références $data, $dispatcher, $form, $results, FOFUtilsObservableDispatcher\getInstance(), et FOFPlatform\getInstance().

◆ publish()

publish (   $publish = 1,
  $user = null 
)

Toggles the published state of one or several items

Paramètres
integer$publishThe publishing state to set (e.g. 0 is unpublished)
integer$userThe user ID performing this action
Renvoie
boolean True on success

Références $context, $name, $user, FOFPlatform\getInstance(), et option.

◆ reorder()

reorder ( )

Reorders all items in the table

Renvoie
boolean

◆ reset()

reset ( )

Resets the model, like it was freshly loaded

Renvoie
FOFModel

Références null.

◆ resetSavedState()

resetSavedState ( )

Resets the saved state for this view

Renvoie
FOFModel

Références null.

◆ save()

save (   $data)

Binds the data to the model and tries to save it

Paramètres
array | object$dataThe source data array or object
Renvoie
boolean True on success

Références $data, $field, $form, $hash, $key, $oid, $type, elseif, et null.

◆ savestate()

& savestate (   $newState)

Sets the model state auto-save status. By default the model is set up to save its state to the session.

Paramètres
boolean$newStateTrue to save the state, false to not save it.
Renvoie
FOFModel Reference to self

Références true.

◆ setBehaviorParam()

setBehaviorParam (   $name,
  $value 
)

Set a behavior param

Paramètres
string$nameThe name of the param
mixed$valueThe param value to set
Renvoie
FOFModel

Références $name, et $value.

◆ setDbo()

setDbo (   $db)

Method to set the database driver object

Paramètres
FOFDatabaseDriver$dbA FOFDatabaseDriver based object
Renvoie
void

Références $db.

◆ setId()

setId (   $id = 0)

Sets the ID and resets internal data

Paramètres
integer$idThe ID to use
Exceptions
InvalidArgumentException
Renvoie
FOFModel

Références $id, et FOFPlatform\getInstance().

◆ setIds()

setIds (   $idlist)

Sets a list of IDs for batch operations from an array and resets the model

Paramètres
array$idlistAn array of item IDs to be set to the model's state
Renvoie
FOFModel

Références $value.

◆ setIDsFromRequest()

setIDsFromRequest ( )

Sets the list of IDs from the request data

Renvoie
FOFModel

Références $id.

◆ setInput()

setInput (   $input)

Set the internal input field

Paramètres
$input
Renvoie
FOFModel

Références $input.

◆ setState()

setState (   $property,
  $value = null 
)

Method to set model state variables

Paramètres
string$propertyThe name of the property.
mixed$valueThe value of the property to set or null.
Renvoie
mixed The previous value of the property or null if not set.

Références $value.

◆ validateForm()

validateForm (   $form,
  $data,
  $group = null 
)

Method to validate the form data.

Paramètres
FOFForm$formThe form to validate against.
array$dataThe data to validate.
string$groupThe name of the field group to validate.
Renvoie
mixed Array of filtered data if valid, false otherwise.
Voir également
JFormRule
JFilterInput
Depuis
2.0

Références $data, $form, $message, et $return.

Documentation des champs

◆ $__state_set

$__state_set = null
protected

◆ $_behaviorParams

$_behaviorParams = array()
protected

◆ $_db

$_db
protected

◆ $_formData

$_formData = array()
protected

◆ $_forms

$_forms = array()
protected

◆ $_savestate

$_savestate = null
protected

◆ $configProvider

$configProvider = null
protected

◆ $default_behaviors

$default_behaviors = array('filters')
protected

◆ $event_after_delete

$event_after_delete = 'onContentAfterDelete'
protected

◆ $event_after_save

$event_after_save = 'onContentAfterSave'
protected

◆ $event_before_delete

$event_before_delete = 'onContentBeforeDelete'
protected

◆ $event_before_save

$event_before_save = 'onContentBeforeSave'
protected

◆ $event_change_state

$event_change_state = 'onContentChangeState'
protected

◆ $event_clean_cache

$event_clean_cache = null
protected

◆ $id

$id = null
protected

◆ $id_list

$id_list = array()
protected

◆ $input

$input = array()
protected

◆ $list

$list = null
protected

◆ $modelDispatcher

$modelDispatcher = null
protected

◆ $name

$name
protected

◆ $option

$option = null
protected

◆ $otable

$otable = null
protected

◆ $pagination

$pagination = null
protected

◆ $record

$record = null
protected

◆ $state

$state
protected

◆ $table

$table = null
protected

◆ $total

$total = null
protected

La documentation de cette classe a été générée à partir du fichier suivant :