Horde_Kolab_Storage_Data_Query_History_Base::_updateLog PHP Method

_updateLog() protected method

Update the history log for an object.
protected _updateLog ( string $object, string $bid, boolean $force = false )
$object string The object ID.
$bid string The backend ID of the object.
$force boolean Force update
    protected function _updateLog($object, $bid, $force = false)
    {
        $last = $this->_history->getLatestEntry($object);
        if ($last === false) {
            // New, unknown object
            $this->_logger->debug(sprintf('[KOLAB_STORAGE] New object to log in Horde_History: %s, uid: %d', $object, $bid));
            $this->_history->log($object, array('action' => 'add', 'bid' => $bid), true);
        } else {
            // If the last action for this object was 'delete', we issue an 'add'.
            // Objects can vanish and re-appear using the same object uid.
            // (a foreign client is sending an update over a slow link)
            if ($last['action'] == 'delete') {
                $this->_logger->debug(sprintf('[KOLAB_STORAGE] Re-adding previously deleted object in Horde_History: %s, uid: %d', $object, $bid));
                $this->_history->log($object, array('action' => 'add', 'bid' => $bid), true);
            }
            if (!isset($last['bid']) || $last['bid'] != $bid || $force) {
                $this->_logger->debug(sprintf('[KOLAB_STORAGE] Modifying object in Horde_History: %s, uid: %d, force: %d', $object, $bid, $force));
                $this->_history->log($object, array('action' => 'modify', 'bid' => $bid), true);
            }
        }
    }