-
Notifications
You must be signed in to change notification settings - Fork 0
/
Account.php
47 lines (46 loc) · 1.77 KB
/
Account.php
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
<?php
/**
* LICENSE
*
* This source file is subject to the new BSD license that is bundled with this
* package in the file LICENSE.txt. It is also available through the
* world-wide-web at this URL: http://dragonjsonserver.de/license. If you did
* not receive a copy of the license and are unable to obtain it through the
* world-wide-web, please send an email to license@dragonjsonserver.de. So we
* can send you a copy immediately.
*
* @copyright Copyright (c) 2012 DragonProjects (http://dragonprojects.de)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @author Christoph Herrmann <developer@dragonjsonserver.de>
*/
/**
* Plugin für Clientnachrichten die der Account empfangen soll
*/
class DragonX_Clientmessage_Plugin_Account implements DragonX_Clientmessage_Plugin_Source_Interface
{
/**
* Wird beim Abholen der Clientnachrichten aufgerufen
* @param integer $lastResponse
* @param integer $actualResponse
* @return RecordList
*/
public function getClientmessages($lastResponse, $actualResponse)
{
if (!Zend_Registry::isRegistered('recordAccount')) {
return new DragonX_Storage_RecordList();
}
return Zend_Registry::get('DragonX_Storage_Engine')->loadBySqlStatement(
new DragonX_Clientmessage_Record_Account(),
"SELECT * FROM `dragonx_clientmessage_record_account` "
. "WHERE "
. " `created` BETWEEN :lastResponse AND :actualResponse "
. " AND "
. " `account_id` = :account_id",
array(
'lastResponse' => $lastResponse,
'actualResponse' => $actualResponse - 1,
'account_id' => Zend_Registry::get('recordAccount')->id,
)
);
}
}