Passed
Push — master ( 9819c1...723c0e )
by Timo
04:53
created

Group::getNumFound()   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 0
1
<?php
2
namespace ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Grouping;
3
4
/***************************************************************
5
 *  Copyright notice
6
 *
7
 *  (c) 2015-2016 Timo Schmidt <[email protected]>
8
 *  All rights reserved
9
 *
10
 *  This script is part of the TYPO3 project. The TYPO3 project is
11
 *  free software; you can redistribute it and/or modify
12
 *  it under the terms of the GNU General Public License as published by
13
 *  the Free Software Foundation; either version 2 of the License, or
14
 *  (at your option) any later version.
15
 *
16
 *  The GNU General Public License can be found at
17
 *  http://www.gnu.org/copyleft/gpl.html.
18
 *
19
 *  This script is distributed in the hope that it will be useful,
20
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
21
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
 *  GNU General Public License for more details.
23
 *
24
 *  This copyright notice MUST APPEAR in all copies of the script!
25
 ***************************************************************/
26
27
/**
28
 * A group is identified by a groupName and can contain multiple groupItems (that reference the search results).
29
 *
30
 * @author Frans Saris <[email protected]>
31
 * @author Timo Hund <[email protected]>
32
 * @package ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Grouping
33
 */
34
class Group
35
{
36
    /**
37
     * @var string
38
     */
39
    protected $groupName = '';
40
41
    /**
42
     * @var GroupItemCollection
43
     */
44
    protected $groupItems = null;
45
46
    /**
47
     * Group constructor.
48
     * @param string $groupName
49
     */
50
    public function __construct(string $groupName)
51
    {
52
        $this->groupName = $groupName;
53
        $this->groupItems = new GroupItemCollection();
54
    }
55
56
    /**
57
     * @return string
58
     */
59
    public function getGroupName(): string
60
    {
61
        return $this->groupName;
62
    }
63
64
    /**
65
     * @param string $groupName
66
     */
67
    public function setGroupName(string $groupName)
68
    {
69
        $this->groupName = $groupName;
70
    }
71
72
    /**
73
     * @return GroupItemCollection
74
     */
75
    public function getGroupItems(): GroupItemCollection
76
    {
77
        return $this->groupItems;
78
    }
79
80
    /**
81
     * @param GroupItemCollection $groupItems
82
     */
83
    public function setGroupItems(GroupItemCollection $groupItems)
84
    {
85
        $this->groupItems = $groupItems;
86
    }
87
88
    /**
89
     * @param GroupItem $groupItem
90
     */
91
    public function addGroupItem(GroupItem $groupItem)
92
    {
93
        $this->groupItems[] = $groupItem;
94
    }
95
}
96