forked from DesignPatternsPHP/DesignPatternsPHP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFile.php
More file actions
39 lines (34 loc) · 630 Bytes
/
File.php
File metadata and controls
39 lines (34 loc) · 630 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?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();
}
}