Completed
Push — master ( 97e40f...89ec5c )
by André
40:26 queued 12:35
created

SearchResult::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace eZ\Publish\API\Repository\Values\Content\Trash;
4
5
use ArrayIterator;
6
use eZ\Publish\API\Repository\Values\ValueObject;
7
8
class SearchResult extends ValueObject implements \IteratorAggregate
9
{
10
    public function __construct(array $properties = [])
11
    {
12
        if (isset($properties['totalCount'])) {
13
            $this->count = $properties['totalCount'];
0 ignored issues
show
Deprecated Code introduced by
The property eZ\Publish\API\Repositor...sh\SearchResult::$count has been deprecated with message: Property is here purely for BC with 5.x/6.x.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
14
        }
15
16
        parent::__construct($properties);
17
    }
18
19
    /**
20
     * The total number of Trash items.
21
     *
22
     * @var int
23
     */
24
    public $totalCount = 0;
25
26
    /**
27
     * The total number of Trash items.
28
     *
29
     * @deprecated Property is here purely for BC with 5.x/6.x.
30
     * @var int
31
     */
32
    public $count = 0;
33
34
    /**
35
     * The Trash items found for the query.
36
     *
37
     * @var \eZ\Publish\API\Repository\Values\Content\TrashItem[]
38
     */
39
    public $items = [];
40
41
    /**
42
     * {@inheritdoc}
43
     */
44
    public function getIterator()
45
    {
46
        return new ArrayIterator($this->items);
47
    }
48
}
49