english/administrator/components/com_checkin/models/checkin.php
/**
	 * Checks in requested tables
	 *
	 * @param	array	An array of table names. Optional.
	 * @return	int		Checked in item count
	 * @since	1.6
	 */
Checks in requested tables
@param       array   An array of table names. Optional.
@return      int             Checked in item count
@since       1.6
Checks in requested tables @param array An array of table names . Optional . @return int Checked in item count @since 1 . 6
public function checkin($ids = array())
	{
		$app		= JFactory::getApplication();
		$db			= $this->_db;
		$nullDate	= $db->getNullDate();
		if (!is_array($ids)) {
			return;
		}
		$results = 0;
		foreach ($ids as $tn) {
			if (stripos($tn, $app->getCfg('dbprefix')) !== 0) {
				continue;
			}
			$fields = $db->getTableFields(array($tn));
			if (!(isset($fields[$tn]['checked_out']) && isset($fields[$tn]['checked_out_time']))) {
				continue;
			}
			$query = $db->getQuery(true)
				->update($db->nameQuote($tn))
				->set('checked_out = 0')
				->set('checked_out_time = '.$db->Quote($nullDate))
				->where('checked_out > 0');
			if (isset($fields[$tn]['editor'])) {
				$query->set('editor = NULL');
			}
			$db->setQuery($query);
			if ($db->query()) {
				$results = $results + $db->getAffectedRows();
			}
		}
		return $results;
	}
public function checkin ( $ ids = array ( ) ) { $ app = JFactory :: getApplication ( ) ; $ db = $ this -> _db ; $ nullDate = $ db -> getNullDate ( ) ; if ( ! is_array ( $ ids ) ) { return ; } $ results = 0 ; foreach ( $ ids as $ tn ) { if ( stripos ( $ tn , $ app -> getCfg ( 'dbprefix' ) ) !== 0 ) { continue ; } $ fields = $ db -> getTableFields ( array ( $ tn ) ) ; if ( ! ( isset ( $ fields [ $ tn ] [ 'checked_out' ] ) && isset ( $ fields [ $ tn ] [ 'checked_out_time' ] ) ) ) { continue ; } $ query = $ db -> getQuery ( true ) -> update ( $ db -> nameQuote ( $ tn ) ) -> set ( 'checked_out = 0' ) -> set ( 'checked_out_time = ' . $ db -> Quote ( $ nullDate ) ) -> where ( 'checked_out > 0' ) ; if ( isset ( $ fields [ $ tn ] [ 'editor' ] ) ) { $ query -> set ( 'editor = NULL' ) ; } $ db -> setQuery ( $ query ) ; if ( $ db -> query ( ) ) { $ results = $ results + $ db -> getAffectedRows ( ) ; } } return $ results ; }
Checks in requested tables
 @param       array   An array of table names.
Checks in requested tables @param array An array of table names .
// this int will hold the checked item count // make sure we get the right tables based on prefix