|
0
|
1 |
<?php |
|
|
2 |
|
|
|
3 |
/* |
|
|
4 |
* This file is part of SwiftMailer. |
|
|
5 |
* (c) 2009 Fabien Potencier <fabien.potencier@gmail.com> |
|
|
6 |
* |
|
|
7 |
* For the full copyright and license information, please view the LICENSE |
|
|
8 |
* file that was distributed with this source code. |
|
|
9 |
*/ |
|
|
10 |
|
|
|
11 |
/** |
|
|
12 |
* Base class for Spools (implements time and message limits). |
|
|
13 |
* @package Swift |
|
|
14 |
* @author Fabien Potencier |
|
|
15 |
*/ |
|
|
16 |
abstract class Swift_ConfigurableSpool implements Swift_Spool |
|
|
17 |
{ |
|
|
18 |
/** The maximum number of messages to send per flush */ |
|
|
19 |
private $_message_limit; |
|
|
20 |
|
|
|
21 |
/** The time limit per flush */ |
|
|
22 |
private $_time_limit; |
|
|
23 |
|
|
|
24 |
/** |
|
|
25 |
* Sets the maximum number of messages to send per flush. |
|
|
26 |
* @param int $limit The limit |
|
|
27 |
*/ |
|
|
28 |
public function setMessageLimit($limit) |
|
|
29 |
{ |
|
|
30 |
$this->_message_limit = (int) $limit; |
|
|
31 |
} |
|
|
32 |
|
|
|
33 |
/** |
|
|
34 |
* Gets the maximum number of messages to send per flush. |
|
|
35 |
* @return int The limit |
|
|
36 |
*/ |
|
|
37 |
public function getMessageLimit() |
|
|
38 |
{ |
|
|
39 |
return $this->_message_limit; |
|
|
40 |
} |
|
|
41 |
|
|
|
42 |
/** |
|
|
43 |
* Sets the time limit (in seconds) per flush. |
|
|
44 |
* @param int $limit The limit |
|
|
45 |
*/ |
|
|
46 |
public function setTimeLimit($limit) |
|
|
47 |
{ |
|
|
48 |
$this->_time_limit = (int) $limit; |
|
|
49 |
} |
|
|
50 |
|
|
|
51 |
/** |
|
|
52 |
* Gets the time limit (in seconds) per flush. |
|
|
53 |
* @return int The limit |
|
|
54 |
*/ |
|
|
55 |
public function getTimeLimit() |
|
|
56 |
{ |
|
|
57 |
return $this->_time_limit; |
|
|
58 |
} |
|
|
59 |
} |