aboutsummaryrefslogtreecommitdiff
path: root/lib/syncdata.php
blob: b8cf87304df57ef9d5b0c96fd817471bec7c2185 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
 * Part of grauphel
 *
 * PHP version 5
 *
 * @category  Tools
 * @package   Grauphel
 * @author    Christian Weiske <cweiske@cweiske.de>
 * @copyright 2014 Christian Weiske
 * @license   http://www.gnu.org/licenses/agpl.html GNU AGPL v3
 * @link      http://cweiske.de/grauphel.htm
 */
namespace OCA\Grauphel\Lib;

/**
 * Synchronization data model
 *
 * @category  Tools
 * @package   Grauphel
 * @author    Christian Weiske <cweiske@cweiske.de>
 * @copyright 2014 Christian Weiske
 * @license   http://www.gnu.org/licenses/agpl.html GNU AGPL v3
 * @version   Release: @package_version@
 * @link      http://cweiske.de/grauphel.htm
 */
class SyncData
{
    /**
     * The latest sync revision from Tomboy, given from last PUT
     * of a note from Tomboy.
     * Give a -1 here if you have not synced with Tomboy yet.,
     *
     * @var integer
     */
    public $latestSyncRevision;
           
    /**
     * A uuid generated by the sync application.
     * It should change only if the user decides to clear their
     * sync history from the server and start over
     * with an empty note set.
     *
     * @var string
     */
    public $currentSyncGuid;

    /**
     * Initialize the variables to represent the data of a user
     * that never synced
     *
     * @param string $username Name of user
     *
     * @return void
     */
    public function initNew($username)
    {
        $this->latestSyncRevision = -1;
        $this->currentSyncGuid    = uniqid($username . '-', true);
    }
}
?>