Actions

API15

JTable/save

From Joomla! Documentation

< API15:JTable
Revision as of 17:16, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
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

Generic save function

[Edit Descripton]

Description:JTable/save

Syntax

save($source, $order_filter='', $ignore='')
Parameter Name Default Value Description
$source Source array for binding to class vars
$order_filter Filter for the order updating
$ignore An array or space separated list of fields not to bind

Returns

TRUE if completely successful, FALSE if partially or not succesful.

Defined in

libraries/joomla/database/table.php

Importing

jimport( 'joomla.database.table' );

Source Body

function save( $source, $order_filter='', $ignore='' )
{
        if (!$this->bind( $source, $ignore )) {
                return false;
        }
        if (!$this->check()) {
                return false;
        }
        if (!$this->store()) {
                return false;
        }
        if (!$this->checkin()) {
                return false;
        }
        if ($order_filter)
        {
                $filter_value = $this->$order_filter;
                $this->reorder( $order_filter ? $this->_db->nameQuote( $order_filter ).' = '.$this->_db->Quote( $filter_value ) : '' );
        }
        $this->setError('');
        return true;
}

[Edit See Also] SeeAlso:JTable/save

Examples

<CodeExamplesForm />