1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | |
7: | |
8: | namespace Aurora\Modules\MailScheduledMessages; |
9: | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | class Manager extends \Aurora\System\Managers\AbstractManagerWithStorage |
16: | { |
17: | public function __construct(\Aurora\System\Module\AbstractModule $oModule = null) |
18: | { |
19: | parent::__construct($oModule, new Storages\Db\Storage($this)); |
20: | } |
21: | |
22: | |
23: | |
24: | |
25: | public function getMessagesForSend($iTimestamp) |
26: | { |
27: | $aMessagesForSend = $this->oStorage->getMessagesForSend($iTimestamp); |
28: | return $aMessagesForSend; |
29: | } |
30: | |
31: | |
32: | |
33: | |
34: | |
35: | |
36: | |
37: | |
38: | |
39: | public function addMessage($iAccountID, $sFolderFullName, $sMessageUid, $iTimestamp) |
40: | { |
41: | return $this->oStorage->addMessage($iAccountID, $sFolderFullName, $sMessageUid, $iTimestamp); |
42: | } |
43: | |
44: | public function updateMessageScheduleTimestamp($iAccountID, $sFolderFullName, $sMessageUid, $iTimestamp) |
45: | { |
46: | return $this->oStorage->updateMessageScheduleTimestamp($iAccountID, $sFolderFullName, $sMessageUid, $iTimestamp); |
47: | } |
48: | |
49: | public function getMessage($iAccountID, $sFolderFullName, $sMessageUid) |
50: | { |
51: | return $this->oStorage->getMessage($iAccountID, $sFolderFullName, $sMessageUid); |
52: | } |
53: | |
54: | public function removeMessage($iAccountID, $sFolderFullName, $sMessageUid) |
55: | { |
56: | return $this->oStorage->removeMessage($iAccountID, $sFolderFullName, $sMessageUid); |
57: | } |
58: | |
59: | |
60: | |
61: | |
62: | |
63: | |
64: | public function createTablesFromFile() |
65: | { |
66: | $bResult = false; |
67: | |
68: | try { |
69: | $sFilePath = dirname(__FILE__) . '/Storages/Db/sql/create.sql'; |
70: | $bResult = \Aurora\System\Managers\Db::getInstance()->executeSqlFile($sFilePath); |
71: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
72: | $this->setLastException($oException); |
73: | } |
74: | |
75: | return $bResult; |
76: | } |
77: | |
78: | |
79: | |
80: | |
81: | |
82: | |
83: | public function insertDataFromFile() |
84: | { |
85: | $bResult = false; |
86: | |
87: | try { |
88: | $sFilePath = dirname(__FILE__) . '/Storages/Db/sql/insert.sql'; |
89: | $bResult = \Aurora\System\Managers\Db::getInstance()->executeSqlFile($sFilePath); |
90: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
91: | $this->setLastException($oException); |
92: | } |
93: | |
94: | return $bResult; |
95: | } |
96: | |
97: | |
98: | |
99: | |
100: | |
101: | |
102: | public function updateTables() |
103: | { |
104: | return true; |
105: | |
106: | |
107: | |
108: | |
109: | |
110: | |
111: | |
112: | |
113: | |
114: | |
115: | |
116: | |
117: | |
118: | |
119: | } |
120: | } |
121: | |