TYPO3  7.6
DateRangeFilterIterator.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11 
12 namespace Symfony\Component\Finder\Iterator;
13 
15 
22 {
23  private $comparators = array();
24 
31  public function __construct(\Iterator $iterator, array $comparators)
32  {
33  $this->comparators = $comparators;
34 
35  parent::__construct($iterator);
36  }
37 
43  public function accept()
44  {
45  $fileinfo = $this->current();
46 
47  if (!file_exists($fileinfo->getRealPath())) {
48  return false;
49  }
50 
51  $filedate = $fileinfo->getMTime();
52  foreach ($this->comparators as $compare) {
53  if (!$compare->test($filedate)) {
54  return false;
55  }
56  }
57 
58  return true;
59  }
60 }