Completed
Pull Request — master (#244)
by Łukasz
11:47
created

DisplayView::add()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/**
4
 * (c) FSi sp. z o.o. <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace FSi\Bundle\AdminBundle\Display;
11
12
use FSi\Bundle\AdminBundle\Display\Property\View;
13
14
class DisplayView implements \IteratorAggregate
15
{
16
    /**
17
     * @var View[]
18
     */
19
    protected $properties;
20
21
    public function __construct()
22
    {
23
        $this->properties = array();
24
    }
25
26
    /**
27
     * @param \FSi\Bundle\AdminBundle\Display\Property\View $propertyView
28
     */
29
    public function add(View $propertyView)
30
    {
31
        $this->properties[] = $propertyView;
32
    }
33
34
    /**
35
     * @return \ArrayIterator|\Traversable
36
     */
37
    public function getIterator()
38
    {
39
        return new \ArrayIterator($this->properties);
40
    }
41
}
42