API16:JTableContent/store
From Joomla! Documentation
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
Contents |
Description
Overriden JTable::store to set modified data and user id.
Description:JTableContent/store
Syntax
store($updateNulls=false)
| Parameter Name | Default Value | Description |
|---|---|---|
| $updateNulls | false | True to update fields even if they are null. |
Returns
boolean True on success.
Defined in
libraries/joomla/database/table/content.php
Importing
jimport( 'joomla.database.table.content' );
Source Body
public function store($updateNulls = false) { $date = JFactory::getDate(); $user = JFactory::getUser(); if ($this->id) { // Existing item $this->modified = $date->toMySQL(); $this->modified_by = $user->get('id'); } else { // New article. An article created and created_by field can be set by the user, // so we don't touch either of these if they are set. if (!intval($this->created)) { $this->created = $date->toMySQL(); } if (empty($this->created_by)) { $this->created_by = $user->get('id'); } } return parent::store($updateNulls); }
[Edit See Also] SeeAlso:JTableContent/store
Examples
<CodeExamplesForm />
