Actions

API15

JTable/checkin

From Joomla! Documentation

< API15:JTable
Revision as of 13:51, 12 May 2013 by JoomlaWikiBot (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

Checks in a row

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

checkin($oid=null)
Parameter Name Default Value Description
$oid null The primary key value for the row

Returns

boolean True if successful, or if checkout is not supported

Defined in

libraries/joomla/database/table.php

Importing

jimport( 'joomla.database.table' );

Source Body

function checkin( $oid=null )
{
        if (!(
                in_array( 'checked_out', array_keys($this->getProperties()) ) ||
                in_array( 'checked_out_time', array_keys($this->getProperties()) )
        )) {
                return true;
        }
 
        $k = $this->_tbl_key;
 
        if ($oid !== null) {
                $this->$k = $oid;
        }
 
        if ($this->$k == NULL) {
                return false;
        }
 
        $query = 'UPDATE '.$this->_db->nameQuote( $this->_tbl ).
                        ' SET checked_out = 0, checked_out_time = '.$this->_db->Quote($this->_db->getNullDate()) .
                        ' WHERE '.$this->_tbl_key.' = '. $this->_db->Quote($this->$k);
        $this->_db->setQuery( $query );
 
        $this->checked_out = 0;
        $this->checked_out_time = '';
 
        return $this->_db->query();
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />