Joomla CMS  3.8.5 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.8.5 et du framework Joomla Platform intégré
Référence de la classe ContentModelArticle
+ Graphe d'héritage de ContentModelArticle:

Fonctions membres publiques

 getTable ($type='Content', $prefix='JTable', $config=array())
 
 getItem ($pk=null)
 
 getForm ($data=array(), $loadData=true)
 
 validate ($form, $data, $group=null)
 
 save ($data)
 
 featured ($pks, $value=0)
 
 hit ()
 
 delete (&$pks)
 
 getItem ($pk=null)
 
 hit ($pk=0)
 
 storeVote ($pk=0, $rate=0)
 

Champs de données

 $typeAlias = 'com_content.article'
 

Fonctions membres protégées

 batchCopy ($value, $pks, $contexts)
 
 canDelete ($record)
 
 canEditState ($record)
 
 prepareTable ($table)
 
 loadFormData ()
 
 getReorderConditions ($table)
 
 preprocessForm (JForm $form, $data, $group='content')
 
 cleanCache ($group=null, $client_id=0)
 
 populateState ()
 

Attributs protégés

 $text_prefix = 'COM_CONTENT'
 
 $associationsContext = 'com_content.item'
 
 $_context = 'com_content.article'
 

Fonctions membres privées

 canCreateCategory ()
 

Description détaillée

Item Model for an Article.

Depuis
1.6

Content Component Article Model

Depuis
1.5

Documentation des fonctions membres

◆ batchCopy()

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

Batch copy items to a new category or current.

Paramètres
integer$valueThe new category.
array$pksAn array of row IDs.
array$contextsAn array of item contexts.
Renvoie
mixed An array of new IDs on success, boolean false on failure.
Depuis
11.1

Références $data, $db, $query, et $value.

◆ canCreateCategory()

canCreateCategory ( )
private

Is the user allowed to create an on the fly category?

Renvoie
boolean
Depuis
3.6.1

◆ 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 set in the component.
Depuis
1.6

◆ canEditState()

canEditState (   $record)
protected

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

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

Références $user.

◆ cleanCache()

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

Custom clean the cache of com_content and content modules

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

◆ delete()

delete ( $pks)

Delete #__content_frontpage items if the deleted articles was featured

Paramètres
object&$pksThe primary key related to the contents that was deleted.
Renvoie
boolean
Depuis
3.7.0

Références $db, $query, et $return.

◆ featured()

featured (   $pks,
  $value = 0 
)

Method to toggle the featured setting of articles.

Paramètres
array$pksThe ids of the items to toggle.
integer$valueThe value to toggle to.
Renvoie
boolean True on success.

Références $columns, $db, $query, et $value.

◆ getForm()

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

Method to get the record form.

Paramètres
array$dataData for the form.
boolean$loadDataTrue if the form is to load its own data (default case), false if not.
Renvoie
JForm|boolean A JForm object on success, false on failure
Depuis
1.6

Références $app, $assoc, $form, $id, $jinput, et $user.

◆ getItem() [1/2]

getItem (   $pk = null)

Method to get article data.

Paramètres
integer$pkThe id of the article.
Renvoie
object|boolean|JException Menu item data object on success, boolean false or JException instance on error

Références $asset, $data, $date, $db, $groups, $published, $query, $user, $userId, elseif, null, et JError\raiseError().

◆ getItem() [2/2]

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.

Références $assoc, $item, et null.

◆ getReorderConditions()

getReorderConditions (   $table)
protected

A protected method to get a set of ordering conditions.

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

◆ getTable()

getTable (   $type = 'Content',
  $prefix = 'JTable',
  $config = array() 
)

Returns a Table object, always creating it.

Paramètres
string$typeThe table type to instantiate
string$prefixA prefix for the table class name. Optional.
array$configConfiguration array for model. Optional.
Renvoie
JTable A database object

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

◆ hit() [1/2]

hit (   $pk = 0)

Increment the hit counter for the article.

Paramètres
integer$pkOptional primary key of the article to increment.
Renvoie
boolean True if successful; false otherwise and internal error set.

Références $input.

◆ hit() [2/2]

hit ( )

Void hit function for pagebreak when editing content from frontend

Renvoie
void
Depuis
3.6.0

◆ loadFormData()

loadFormData ( )
protected

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

Renvoie
mixed The data for the form.
Depuis
1.6

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

◆ populateState()

populateState ( )
protected

Method to auto-populate the model state.

Note. Calling getState in this method will result in recursion.

Depuis
1.6
Renvoie
void

Références $app, $offset, $params, et $user.

◆ prepareTable()

prepareTable (   $table)
protected

Prepare and sanitise the table data prior to saving.

Paramètres
JTable$tableA JTable object.
Renvoie
void
Depuis
1.6

◆ preprocessForm()

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

Allows preprocessing of the JForm object.

Paramètres
JForm$formThe form object
array$dataThe data to be merged into the form object
string$groupThe plugin group to be executed
Renvoie
void
Depuis
3.0

Références $data, $field, $fields, $form, $language, et null.

◆ save()

save (   $data)

Method to save the form data.

Paramètres
array$dataThe form data.
Renvoie
boolean True on success.
Depuis
1.6

Références $check, $data, $filter, $i, $input, $title, $url, CategoriesHelper\createCategory(), JPATH_ADMINISTRATOR, null, JLoader\register(), et CategoriesHelper\validateCategoryId().

◆ storeVote()

storeVote (   $pk = 0,
  $rate = 0 
)

Save user vote on article

Paramètres
integer$pkJoomla Article Id
integer$rateVoting rate
Renvoie
boolean Return true on success

Références $db, $query, $rating, et JError\raiseWarning().

◆ 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.7.0

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

Documentation des champs

◆ $_context

$_context = 'com_content.article'
protected

◆ $associationsContext

$associationsContext = 'com_content.item'
protected

◆ $text_prefix

$text_prefix = 'COM_CONTENT'
protected

◆ $typeAlias

$typeAlias = 'com_content.article'

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