API15:JTable/store
From Joomla! Documentation
Description
Inserts a new row if id is zero or updates an existing row in the database table
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
store($updateNulls=false)
| Parameter Name | Default Value | Description |
|---|---|---|
| $updateNulls | false | If false, null object variables are not updated |
Returns
null|string null if successful otherwise returns and error message
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function store( $updateNulls=false )
{
$k = $this->_tbl_key;
if( $this->$k)
{
$ret = $this->_db->updateObject( $this->_tbl, $this, $this->_tbl_key, $updateNulls );
}
else
{
$ret = $this->_db->insertObject( $this->_tbl, $this, $this->_tbl_key );
}
if( !$ret )
{
$this->setError(get_class( $this ).'::store failed - '.$this->_db->getErrorMsg());
return false;
}
else
{
return true;
}
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
Code Examples