1: <?php
2:
3: /**
4: * Avisota newsletter and mailing system
5: *
6: * PHP Version 5.3
7: *
8: * @copyright bit3 UG 2013
9: * @author Tristan Lins <tristan.lins@bit3.de>
10: * @package avisota-core
11: * @license LGPL-3.0+
12: * @link http://avisota.org
13: */
14:
15: namespace Avisota\Queue;
16:
17: /**
18: * The execution config for a queue.
19: *
20: * @package avisota-core
21: */
22: class ExecutionConfig
23: {
24: /**
25: * Limit execution count.
26: *
27: * @var int
28: */
29: protected $messageLimit = 0;
30:
31: /**
32: * Limit execution time in seconds.
33: *
34: * @var int
35: */
36: protected $timeLimit = 0;
37:
38: /**
39: * @var ExecutionDeciderInterface
40: */
41: protected $decider = null;
42:
43: /**
44: * @param int $messageLimit
45: */
46: public function setMessageLimit($messageLimit)
47: {
48: $this->messageLimit = (int) $messageLimit;
49: return $this;
50: }
51:
52: /**
53: * @return int
54: */
55: public function getMessageLimit()
56: {
57: return $this->messageLimit;
58: }
59:
60: /**
61: * @param int $timeLimit
62: */
63: public function setTimeLimit($timeLimit)
64: {
65: $this->timeLimit = $timeLimit;
66: return $this;
67: }
68:
69: /**
70: * @return int
71: */
72: public function getTimeLimit()
73: {
74: return $this->timeLimit;
75: }
76:
77: /**
78: * @param \Avisota\Queue\ExecutionDeciderInterface $decider
79: */
80: public function setDecider(ExecutionDeciderInterface $decider)
81: {
82: $this->decider = $decider;
83: return $this;
84: }
85:
86: /**
87: * @return \Avisota\Queue\ExecutionDeciderInterface
88: */
89: public function getDecider()
90: {
91: return $this->decider;
92: }
93: }