Completed
Push — ezp_24520 ( 28972c )
by
unknown
28:46 queued 13:31
created

SearchResult   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 59
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getIterator() 0 4 1
1
<?php
2
3
/**
4
 * File containing the eZ\Publish\API\Repository\Values\Content\Search\SearchResult class.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 */
9
namespace eZ\Publish\API\Repository\Values\Content\Search;
10
11
use ArrayIterator;
12
use eZ\Publish\API\Repository\Values\ValueObject;
13
use IteratorAggregate;
14
use Traversable;
15
16
/**
17
 * This class represents a search result.
18
 */
19
class SearchResult extends ValueObject implements IteratorAggregate
20
{
21
    /**
22
     * The facets for this search.
23
     *
24
     * @var \eZ\Publish\API\Repository\Values\Content\Search\Facet[]
25
     */
26
    public $facets = [];
27
28
    /**
29
     * The value objects found for the query.
30
     *
31
     * @var \eZ\Publish\API\Repository\Values\Content\Search\SearchHit[]
32
     */
33
    public $searchHits = [];
34
35
    /**
36
     * If spellcheck is on this field contains a collated query suggestion where in the appropriate
37
     * criterions the wrong spelled value is replaced by a corrected one (TBD).
38
     *
39
     * @var \eZ\Publish\API\Repository\Values\Content\Query\Criterion
40
     */
41
    public $spellSuggestion;
42
43
    /**
44
     * The duration of the search processing in ms.
45
     *
46
     * @var int
47
     */
48
    public $time;
49
50
    /**
51
     * Indicates if the search has timed out.
52
     *
53
     * @var bool
54
     */
55
    public $timedOut;
56
57
    /**
58
     * The maximum score of this query.
59
     *
60
     * @var float
61
     */
62
    public $maxScore;
63
64
    /**
65
     * The total number of searchHits.
66
     *
67
     * `null` if Query->performCount was set to false and search engine avoids search lookup.
68
     *
69
     * @var int|null
70
     */
71
    public $totalCount;
72
73
    public function getIterator(): Traversable
74
    {
75
        return new ArrayIterator($this->searchHits);
76
    }
77
}
78