1 | <?php |
||
10 | class PersistCollectionToFile implements PersistCollectionInterface |
||
11 | { |
||
12 | const DATA_FILE_NAME = 'email_send_receive_collection.data'; |
||
13 | |||
14 | /** |
||
15 | * @var string; |
||
16 | */ |
||
17 | private $savePath; |
||
18 | |||
19 | /** |
||
20 | * @var string; |
||
21 | */ |
||
22 | private $saveFileName = self::DATA_FILE_NAME; |
||
23 | |||
24 | /** |
||
25 | * @var EmailSendReceiveCollection; |
||
26 | */ |
||
27 | private $emailSendReceiveC; |
||
28 | |||
29 | |||
30 | /** |
||
31 | * PersistCollectionToFile constructor. |
||
32 | * @param string $savePath |
||
33 | * @param null|string $saveFileName |
||
34 | * @throws PersistCollectionToFileException |
||
35 | */ |
||
36 | 16 | public function __construct($savePath, $saveFileName = null) |
|
44 | |||
45 | /** |
||
46 | * PersistCollectionToFiledestruct. |
||
47 | */ |
||
48 | 3 | public function __destruct() |
|
52 | |||
53 | /** |
||
54 | * @param EmailSendReceiveCollection $emailSendReceiveC |
||
55 | */ |
||
56 | 14 | public function persist(EmailSendReceiveCollection $emailSendReceiveC) |
|
60 | |||
61 | /** |
||
62 | * @return bool |
||
63 | */ |
||
64 | 14 | public function flush() |
|
71 | |||
72 | /** |
||
73 | * @return null|EmailSendReceiveCollection |
||
74 | */ |
||
75 | 14 | public function load() |
|
95 | |||
96 | /** |
||
97 | * @return bool |
||
98 | */ |
||
99 | 2 | public function delete() |
|
109 | |||
110 | |||
111 | |||
112 | /** |
||
113 | * @return string |
||
114 | */ |
||
115 | 14 | protected function getSavePath() |
|
119 | |||
120 | /** |
||
121 | * @param string $savePath |
||
122 | * @throws PersistCollectionToFileException |
||
123 | */ |
||
124 | 16 | protected function setSavePath($savePath) |
|
131 | |||
132 | /** |
||
133 | * @return EmailSendReceiveCollection |
||
134 | */ |
||
135 | 14 | protected function getEmailSendReceiveC() |
|
139 | |||
140 | /** |
||
141 | * @param EmailSendReceiveCollection $emailSendReceiveC |
||
142 | */ |
||
143 | 14 | protected function setEmailSendReceiveC(EmailSendReceiveCollection $emailSendReceiveC) |
|
147 | |||
148 | /** |
||
149 | * @return string |
||
150 | */ |
||
151 | 14 | public function getDataFilePath() |
|
155 | |||
156 | /** |
||
157 | * @return string |
||
158 | */ |
||
159 | 14 | protected function getSaveFileName() |
|
163 | |||
164 | /** |
||
165 | * @param string $saveFileName |
||
166 | */ |
||
167 | 2 | protected function setSaveFileName($saveFileName) |
|
171 | } |
||
172 |