1: <?php
2: /**
3: * The cache based hook that updates the Horde history information once data
4: * gets synchronized with the Kolab backend.
5: *
6: * PHP version 5
7: *
8: * @category Kolab
9: * @package Kolab_Storage
10: * @author Gunnar Wrobel <wrobel@pardus.de>
11: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
12: * @link http://pear.horde.org/index.php?package=Kolab_Storage
13: */
14:
15: /**
16: * The cache based hook that updates the Horde history information once data
17: * gets synchronized with the Kolab backend.
18: *
19: * Copyright 2011-2012 Horde LLC (http://www.horde.org/)
20: *
21: * See the enclosed file COPYING for license information (LGPL). If you
22: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
23: *
24: * @since Horde_Kolab_Storage 1.1.0
25: *
26: * @category Kolab
27: * @package Kolab_Storage
28: * @author Gunnar Wrobel <wrobel@pardus.de>
29: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
30: * @link http://pear.horde.org/index.php?package=Kolab_Storage
31: */
32: class Horde_Kolab_Storage_Data_Query_History_Cache
33: extends Horde_Kolab_Storage_Data_Query_History_Base
34: {
35: /**
36: * Synchronize the preferences information with the information from the
37: * backend.
38: *
39: * @param array $params Additional parameters.
40: *
41: * @return NULL
42: */
43: public function synchronize($params = array())
44: {
45: if (isset($params['last_sync']) &&
46: ($params['last_sync'] === false ||
47: $params['last_sync'] !== $this->history->getActionTimestamp(__CLASS__ , 'sync'))) {
48: /**
49: * Ignore current changeset and do a full synchronization as we are
50: * out of sync
51: */
52: unset($params['changes']);
53: }
54: parent::synchronize($params);
55: if (isset($params['current_sync'])) {
56: $this->history->log(
57: __CLASS__ ,
58: array('action' => 'sync', 'ts' => $params['current_sync'])
59: );
60: }
61: }
62: }