2014-03-21 18:03:45 -03:00

40 lines
630 B
PHP

<?php
namespace DesignPatterns\Iterator;
/**
* class File
*
* THIS EXAMPLE ALSO APPLIES THE COMPOSITE PATTERN
*/
class File
{
/**
* @var RowSet
*/
protected $rowSet;
/**
* @var string
*/
protected $pathName;
/**
* @param string $pathName
*/
public function __construct($pathName)
{
$this->rowSet = new Rowset($this);
}
/**
* processes the rowSet
*/
public function process()
{
// this is the place to show how using an iterator, with foreach
// See the CardGame.php file
$this->rowSet->process();
}
}