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é
Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe FieldsModelField
+ Graphe d'héritage de FieldsModelField:

Fonctions membres publiques

 __construct ($config=array())
 
 save ($data)
 
 getItem ($pk=null)
 
 getTable ($name='Field', $prefix='FieldsTable', $options=array())
 
 delete (&$pks)
 
 getForm ($data=array(), $loadData=true)
 
 setFieldValue ($fieldId, $itemId, $value)
 
 getFieldValue ($fieldId, $itemId)
 
 getFieldValues (array $fieldIds, $itemId)
 
 cleanupValues ($context, $itemId)
 
 validate ($form, $data, $group=null)
 

Champs de données

 $typeAlias = null
 

Fonctions membres protégées

 generateNewTitle ($categoryId, $name, $title)
 
 canDelete ($record)
 
 canEditState ($record)
 
 populateState ()
 
 getReorderConditions ($table)
 
 loadFormData ()
 
 preprocessForm (JForm $form, $data, $group='content')
 
 cleanCache ($group=null, $clientId=0)
 
 batchCopy ($value, $pks, $contexts)
 
 batchMove ($value, $pks, $contexts)
 

Attributs protégés

 $text_prefix = 'COM_FIELDS'
 
 $batch_copymove = 'group_id'
 
 $batch_commands
 

Fonctions membres privées

 checkDefaultValue ($data)
 
 getParams ($params)
 

Attributs privés

 $valueCache = array()
 

Description détaillée

Field Model

Depuis
3.7.0

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $config = array())

Constructor.

Paramètres
array$configAn optional associative array of configuration settings.
Voir également
JModelLegacy
Depuis
3.7.0

Références $config.

Documentation des fonctions membres

◆ batchCopy()

batchCopy (   $value,
  $pks,
  $contexts 
)
protected

Batch copy fields to a new group.

Paramètres
integer$valueThe new value matching a fields group.
array$pksAn array of row IDs.
array$contextsAn array of item contexts.
Renvoie
array|boolean new IDs if successful, false otherwise and internal error is set.
Depuis
3.7.0

Références $component, $user, et $value.

◆ batchMove()

batchMove (   $value,
  $pks,
  $contexts 
)
protected

Batch move fields to a new group.

Paramètres
integer$valueThe new value matching a fields group.
array$pksAn array of row IDs.
array$contextsAn array of item contexts.
Renvoie
boolean True if successful, false otherwise and internal error is set.
Depuis
3.7.0

Références $context, $user, et $value.

◆ canDelete()

canDelete (   $record)
protected

Method to test whether a record can be deleted.

Paramètres
object$recordA record object.
Renvoie
boolean True if allowed to delete the record. Defaults to the permission for the component.
Depuis
3.7.0

Références $parts, et FieldsHelper\extract().

◆ canEditState()

canEditState (   $record)
protected

Method to test whether a record can have its state changed.

Paramètres
object$recordA record object.
Renvoie
boolean True if allowed to change the state of the record. Defaults to the permission for the component.
Depuis
3.7.0

Références $parts, $user, et FieldsHelper\extract().

◆ checkDefaultValue()

checkDefaultValue (   $data)
private

Checks if the default value is valid for the given data. If a string is returned then it can be assumed that the default value is invalid.

Paramètres
array$dataThe data.
Renvoie
true|string true if valid, a string containing the exception message when not.
Depuis
3.7.0

Références $data, $path, $type, FieldsHelper\getFieldTypes(), et JEventDispatcher\getInstance().

◆ cleanCache()

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

Clean the cache

Paramètres
string$groupThe cache group
integer$clientIdThe ID of the client
Renvoie
void
Depuis
3.7.0

Références $context.

◆ cleanupValues()

cleanupValues (   $context,
  $itemId 
)

Cleaning up the values for the given item on the context.

Paramètres
string$contextThe context.
string$itemIdThe Item ID.
Renvoie
void
Depuis
3.7.0

Références $context, $itemId, et $query.

◆ delete()

delete ( $pks)

Method to delete one or more records.

Paramètres
array$pksAn array of record primary keys.
Renvoie
boolean True if successful, false if an error occurs.
Depuis
3.7.0

Références $query.

◆ generateNewTitle()

generateNewTitle (   $categoryId,
  $name,
  $title 
)
protected

Method to change the title & name.

Paramètres
integer$categoryIdThe id of the category.
string$nameThe name.
string$titleThe title.
Renvoie
array Contains the modified title and name.
Depuis
3.7.0

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

◆ getFieldValue()

getFieldValue (   $fieldId,
  $itemId 
)

Returning the value for the given field id, context and item id.

Paramètres
string$fieldIdThe field ID.
string$itemIdThe ID of the item.
Renvoie
NULL|string
Depuis
3.7.0

Références $itemId, et null.

◆ getFieldValues()

getFieldValues ( array  $fieldIds,
  $itemId 
)

Returning the values for the given field ids, context and item id.

Paramètres
array$fieldIdsThe field Ids.
string$itemIdThe ID of the item.
Renvoie
NULL|array
Depuis
3.7.0

Références $data, $itemId, $key, $query, $row, et $rows.

◆ getForm()

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

Abstract 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.
Renvoie
mixed A JForm object on success, false on failure
Depuis
3.7.0

Références $context, $data, $form, $jinput, $parts, et FieldsHelper\extract().

◆ getItem()

getItem (   $pk = null)

Method to get a single record.

Paramètres
integer$pkThe id of the primary key.
Renvoie
mixed Object on success, false on failure.
Depuis
3.7.0

Références $db, $query, Registry\loadString(), et null.

◆ getParams()

getParams (   $params)
private

Converts the unknown params into an object.

Paramètres
mixed$paramsThe params.
Renvoie
stdClass Object on success, false on failure.
Depuis
3.7.0

Références $params.

◆ getReorderConditions()

getReorderConditions (   $table)
protected

A protected method to get a set of ordering conditions.

Paramètres
JTable$tableA JTable object.
Renvoie
array An array of conditions to add to ordering queries.
Depuis
3.7.0

◆ getTable()

getTable (   $name = 'Field',
  $prefix = 'FieldsTable',
  $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.
Renvoie
JTable A JTable object
Depuis
3.7.0
Exceptions
Exception

Références $name, $options, $prefix, et JPATH_ADMINISTRATOR.

◆ 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
3.7.0

Références $app, $data, $filters, et null.

◆ populateState()

populateState ( )
protected

Stock method to auto-populate the model state.

Renvoie
void
Depuis
3.7.0

Références $app, $context, $params, $parts, FieldsHelper\extract(), et null.

◆ preprocessForm()

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

Method to allow derived classes to preprocess the form.

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

Références $component, $data, $form, $key, $lang, $path, $section, JPATH_ADMINISTRATOR, JPATH_BASE, et null.

◆ save()

save (   $data)

Method to save the form data.

Paramètres
array$dataThe form data.
Renvoie
boolean True on success, False on error.
Depuis
3.7.0

Références $data, $db, $field, $id, $input, $message, $name, $names, $param, $query, $title, FieldsHelper\clearFieldsCache(), et null.

◆ setFieldValue()

setFieldValue (   $fieldId,
  $itemId,
  $value 
)

Setting the value for the given field id, context and item id.

Paramètres
string$fieldIdThe field ID.
string$itemIdThe ID of the item.
string$valueThe value.
Renvoie
boolean
Depuis
3.7.0

Références $field, $itemId, $params, $query, $value, FieldsHelper\canEditFieldValue(), FieldsHelper\clearFieldsCache(), elseif, et null.

◆ validate()

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

Method to validate the form data.

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

Références $data, $form, et validate().

Documentation des champs

◆ $batch_commands

$batch_commands
protected
Valeur initiale :
= array(
'assetgroup_id' => 'batchAccess',
'language_id' => 'batchLanguage'
)

◆ $batch_copymove

$batch_copymove = 'group_id'
protected

◆ $text_prefix

$text_prefix = 'COM_FIELDS'
protected

◆ $typeAlias

$typeAlias = null

◆ $valueCache

$valueCache = array()
private

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