TYPO3  7.6
ArrayRecipientIterator.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of SwiftMailer.
5  * (c) 2004-2009 Chris Corbyn
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10 
17 {
23  private $_recipients = array();
24 
30  public function __construct(array $recipients)
31  {
32  $this->_recipients = $recipients;
33  }
34 
40  public function hasNext()
41  {
42  return !empty($this->_recipients);
43  }
44 
51  public function nextRecipient()
52  {
53  return array_splice($this->_recipients, 0, 1);
54  }
55 }