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 | 17 | public function __construct($savePath = null, $saveFileName = null) |
|
47 | |||
48 | /** |
||
49 | * PersistCollectionToFiledestruct. |
||
50 | */ |
||
51 | 4 | public function __destruct() |
|
55 | |||
56 | /** |
||
57 | * @param EmailSendReceiveCollection $emailSendReceiveC |
||
58 | */ |
||
59 | 14 | public function persist(EmailSendReceiveCollection $emailSendReceiveC) |
|
63 | |||
64 | /** |
||
65 | * @return bool |
||
66 | */ |
||
67 | 15 | public function flush() |
|
74 | |||
75 | /** |
||
76 | * @return null|EmailSendReceiveCollection |
||
77 | */ |
||
78 | 14 | public function load() |
|
98 | |||
99 | /** |
||
100 | * @return bool |
||
101 | */ |
||
102 | 2 | public function delete() |
|
112 | |||
113 | |||
114 | |||
115 | /** |
||
116 | * @return string |
||
117 | */ |
||
118 | 15 | protected function getSavePath() |
|
122 | |||
123 | /** |
||
124 | * @param string $savePath |
||
125 | * @throws PersistCollectionToFileException |
||
126 | */ |
||
127 | 17 | protected function setSavePath($savePath) |
|
134 | |||
135 | /** |
||
136 | * @return EmailSendReceiveCollection |
||
137 | */ |
||
138 | 15 | protected function getEmailSendReceiveC() |
|
142 | |||
143 | /** |
||
144 | * @param EmailSendReceiveCollection $emailSendReceiveC |
||
145 | */ |
||
146 | 14 | protected function setEmailSendReceiveC(EmailSendReceiveCollection $emailSendReceiveC) |
|
150 | |||
151 | /** |
||
152 | * @return string |
||
153 | */ |
||
154 | 15 | public function getDataFilePath() |
|
158 | |||
159 | /** |
||
160 | * @return string |
||
161 | */ |
||
162 | 15 | protected function getSaveFileName() |
|
166 | |||
167 | /** |
||
168 | * @param string $saveFileName |
||
169 | */ |
||
170 | 2 | protected function setSaveFileName($saveFileName) |
|
174 | } |
||
175 |