Beispiel #1
0
 /**
  * Checks in a row
  *
  * @access	public
  * @param	mixed	The primary key value for the row
  * @return	boolean	True if successful, or if checkout is not supported
  */
 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();
 }