1 | <?php |
||
14 | class Swift_MongoSpool extends Swift_ConfigurableSpool |
||
15 | { |
||
16 | /** |
||
17 | * @var \MongoCollection The collection of queued emails |
||
18 | */ |
||
19 | protected $collection; |
||
20 | |||
21 | /** |
||
22 | * Creates a new MongoSpool |
||
23 | * |
||
24 | * @param \MongoCollection $collection The collection for messages |
||
25 | */ |
||
26 | public function __construct(\MongoCollection $collection) |
||
30 | |||
31 | /** |
||
32 | * Tests if this Spool mechanism has started. |
||
33 | * |
||
34 | * @return bool |
||
35 | */ |
||
36 | public function isStarted() |
||
40 | |||
41 | /** |
||
42 | * Starts this Spool mechanism. |
||
43 | */ |
||
44 | public function start() |
||
47 | |||
48 | /** |
||
49 | * Stops this Spool mechanism. |
||
50 | */ |
||
51 | public function stop() |
||
54 | |||
55 | /** |
||
56 | * Queues a message. |
||
57 | * |
||
58 | * @param Swift_Mime_Message $message The message to store |
||
59 | * @return bool |
||
60 | * @throws Swift_IoException |
||
61 | */ |
||
62 | public function queueMessage(Swift_Mime_Message $message) |
||
74 | |||
75 | /** |
||
76 | * Execute a recovery if for any reason a process is sending for too long. |
||
77 | * |
||
78 | * @param int $timeout in second Defaults is for very slow smtp responses |
||
79 | * @throws Swift_IoException |
||
80 | */ |
||
81 | public function recover($timeout = 900) |
||
89 | |||
90 | /** |
||
91 | * Sends messages using the given transport instance. |
||
92 | * |
||
93 | * @param Swift_Transport $transport A transport instance |
||
94 | * @param string[] $failedRecipients An array of failures by-reference |
||
95 | * @return int The number of sent e-mails |
||
96 | * @throws Swift_IoException |
||
97 | */ |
||
98 | public function flushQueue(Swift_Transport $transport, &$failedRecipients = null) |
||
134 | |||
135 | /** |
||
136 | * Executes a bulk write to MongoDB, wrapping exceptions. |
||
137 | * |
||
138 | * @param array $query |
||
139 | * @param array $set |
||
140 | * @param arary $options |
||
141 | * @throws Swift_IoException if things go wrong |
||
142 | */ |
||
143 | protected function write(array $query, array $set, array $options = array()) |
||
151 | } |
||
152 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.