Offline Server  1.6
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Interface.DomainHook.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Return offline domains where current user is affected
4  *
5  * @author Anakeen
6  * @version $Id: $
7  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
8  * @package OFFLINE
9  */
10 /**
11  */
12 
13 
14 interface DomainHook
15 {
16 
17  /**
18  * call before synchronize all user documents from server to client
19  * if return error the pull is aborted
20  * @param _OfflineDomain $domain the current domain document
21  * @return string error message
22  */
23  public function onBeforePullUserDocuments(_OfflineDomain &$domain);
24 
25  /**
26  * call before synchronize all shared documents from server to client
27  * if return error the pull is aborted
28  * @param _OfflineDomain $domain the current domain document
29  * @return string error message
30  */
31  public function onBeforePullSharedDocuments(_OfflineDomain &$domain);
32 
33  /**
34  * call before synchronize a documents from server to client
35  * if return error the pull of the document is aborted
36  * @param _OfflineDomain $domain the current domain document
37  * @param Doc $doc the document to pull
38  * @return string error message
39  */
40  public function onPullDocument(_OfflineDomain &$domain, Doc &$doc);
41  /**
42  * call after all user documents are be transfered from server to client
43  *
44  * @param _OfflineDomain $domain the current domain document
45  * @return void
46  */
47  public function onAfterPullUserDocuments(_OfflineDomain &$domain);
48  /**
49  * call after all shared documents are be transfered from server to client
50  *
51  * @param _OfflineDomain $domain the current domain document
52  * @return void
53  */
54  public function onAfterPullSharedDocuments(_OfflineDomain &$domain);
55 
56  /**
57  * call before begin transaction to transfered modification from client to server
58  * if return error the transaction is aborted
59  * @param _OfflineDomain $domain the current domain document
60  * @return string error message
61  */
62  public function onBeforePushTransaction(_OfflineDomain &$domain);
63  /**
64  * call before push document from client to server
65  * if return error the push is aborted
66  * @param _OfflineDomain $domain the current domain document
67  * @param Doc $doc the document to push
68  * @param Object $extraData extra data set by client
69  * @return string error message
70  */
71  public function onBeforePushDocument(_OfflineDomain &$domain, Doc &$doc, $extraData=null);
72  /**
73  * call after push document from client to server
74  * the document waiting from the transation end to be recording in database
75  * @param _OfflineDomain $domain the current domain document
76  * @param Doc $doc the document to push
77  * @param Object $extraData extra data set by client
78  * @return void
79  */
80  public function onAfterPushDocument(_OfflineDomain &$domain, Doc &$doc, $extraData=null);
81  /**
82  * call after all documents are been transfered from client to server
83  * at the step documents waiting to be recorded
84  * @param _OfflineDomain $domain the current domain document
85  * @return void
86  */
87  public function onAfterPushTransaction(_OfflineDomain &$domain);
88 
89 
90  /**
91  * call before record document which waiting after a push request
92  * if return error the recording is aborted
93  * @param _OfflineDomain $domain the current domain document
94  * @param Doc $waitDoc the waiting document
95  * @param Doc $refererDoc the referer document (can be null if it is a document creation)
96  * @param Object $extraData extra data set by client
97  * @return string error message
98  */
99  public function onBeforeSaveDocument(_OfflineDomain &$domain, Doc &$waitDoc, Doc &$refererDoc=null, $extraData=null);
100 
101  /**
102  * call after record document
103  *
104  * @param _OfflineDomain $domain the current domain document
105  * @param Doc $updatedDoc the updated document
106  * @param Object $extraData extra data set by client
107  * @return void
108  */
109  public function onAfterSaveDocument(_OfflineDomain &$domain, Doc &$updatedDoc, $extraData=null);
110 
111  /**
112  * final call after all document records
113  *
114  * @param _OfflineDomain $domain the current domain document
115  * @return void
116  */
117  public function onAfterSaveTransaction(_OfflineDomain &$domain);
118 }
119 ?>
onPullDocument(_OfflineDomain &$domain, Doc &$doc)
onBeforePullSharedDocuments(_OfflineDomain &$domain)
onAfterPushDocument(_OfflineDomain &$domain, Doc &$doc, $extraData=null)
onAfterPullSharedDocuments(_OfflineDomain &$domain)
onBeforePushDocument(_OfflineDomain &$domain, Doc &$doc, $extraData=null)
onBeforePushTransaction(_OfflineDomain &$domain)
onAfterPullUserDocuments(_OfflineDomain &$domain)
onBeforeSaveDocument(_OfflineDomain &$domain, Doc &$waitDoc, Doc &$refererDoc=null, $extraData=null)
onAfterPushTransaction(_OfflineDomain &$domain)
onAfterSaveTransaction(_OfflineDomain &$domain)
onAfterSaveDocument(_OfflineDomain &$domain, Doc &$updatedDoc, $extraData=null)
onBeforePullUserDocuments(_OfflineDomain &$domain)
← centre documentaire © anakeen - published under CC License - Dynacase