update changelog
[grauphel.git] / lib / syncdata.php
1 <?php
2 /**
3  * Part of grauphel
4  *
5  * PHP version 5
6  *
7  * @category  Tools
8  * @package   Grauphel
9  * @author    Christian Weiske <cweiske@cweiske.de>
10  * @copyright 2014 Christian Weiske
11  * @license   http://www.gnu.org/licenses/agpl.html GNU AGPL v3
12  * @link      http://cweiske.de/grauphel.htm
13  */
14 namespace OCA\Grauphel\Lib;
15
16 /**
17  * Synchronization data model
18  *
19  * @category  Tools
20  * @package   Grauphel
21  * @author    Christian Weiske <cweiske@cweiske.de>
22  * @copyright 2014 Christian Weiske
23  * @license   http://www.gnu.org/licenses/agpl.html GNU AGPL v3
24  * @version   Release: @package_version@
25  * @link      http://cweiske.de/grauphel.htm
26  */
27 class SyncData
28 {
29     /**
30      * The latest sync revision from Tomboy, given from last PUT
31      * of a note from Tomboy.
32      * Give a -1 here if you have not synced with Tomboy yet.,
33      *
34      * @var integer
35      */
36     public $latestSyncRevision;
37            
38     /**
39      * A uuid generated by the sync application.
40      * It should change only if the user decides to clear their
41      * sync history from the server and start over
42      * with an empty note set.
43      *
44      * @var string
45      */
46     public $currentSyncGuid;
47
48     /**
49      * Initialize the variables to represent the data of a user
50      * that never synced
51      *
52      * @param string $username Name of user
53      *
54      * @return void
55      */
56     public function initNew($username)
57     {
58         $this->latestSyncRevision = -1;
59         $this->currentSyncGuid    = uniqid($username . '-', true);
60     }
61 }
62 ?>