|
1
|
|
|
<?php |
|
2
|
|
|
namespace ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\OptionBased; |
|
3
|
|
|
|
|
4
|
|
|
/* |
|
5
|
|
|
* This file is part of the TYPO3 CMS project. |
|
6
|
|
|
* |
|
7
|
|
|
* It is free software; you can redistribute it and/or modify it under |
|
8
|
|
|
* the terms of the GNU General Public License, either version 2 |
|
9
|
|
|
* of the License, or any later version. |
|
10
|
|
|
* |
|
11
|
|
|
* For the full copyright and license information, please read the |
|
12
|
|
|
* LICENSE.txt file that was distributed with this source code. |
|
13
|
|
|
* |
|
14
|
|
|
* The TYPO3 project - inspiring people to share! |
|
15
|
|
|
*/ |
|
16
|
|
|
use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\AbstractFacet; |
|
17
|
|
|
use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\AbstractFacetItem; |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* Base class for all facet items that are represented as option |
|
21
|
|
|
* |
|
22
|
|
|
* @author Frans Saris <[email protected]> |
|
23
|
|
|
* @author Timo Hund <[email protected]> |
|
24
|
|
|
* @package ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\OptionsFacet |
|
25
|
|
|
*/ |
|
26
|
|
|
class AbstractOptionFacetItem extends AbstractFacetItem |
|
27
|
|
|
{ |
|
28
|
|
|
/** |
|
29
|
|
|
* @var string |
|
30
|
|
|
*/ |
|
31
|
|
|
protected $value = ''; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @param AbstractFacet $facet |
|
35
|
|
|
* @param string $label |
|
36
|
|
|
* @param string $value |
|
37
|
|
|
* @param int $documentCount |
|
38
|
|
|
* @param bool $selected |
|
39
|
|
|
*/ |
|
40
|
57 |
|
public function __construct(AbstractFacet $facet, $label = '', $value = '', $documentCount = 0, $selected = false) |
|
41
|
|
|
{ |
|
42
|
57 |
|
$this->value = $value; |
|
43
|
57 |
|
parent::__construct($facet, $label, $documentCount, $selected); |
|
44
|
57 |
|
} |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @return string |
|
48
|
|
|
*/ |
|
49
|
55 |
|
public function getValue() |
|
50
|
|
|
{ |
|
51
|
55 |
|
return $this->value; |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
/** |
|
55
|
|
|
* @return string |
|
56
|
|
|
*/ |
|
57
|
21 |
|
public function getUriValue() |
|
58
|
|
|
{ |
|
59
|
21 |
|
return $this->getValue(); |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
/** |
|
63
|
|
|
* @return string |
|
64
|
|
|
*/ |
|
65
|
55 |
|
public function getCollectionKey() |
|
66
|
|
|
{ |
|
67
|
55 |
|
return $this->getValue(); |
|
68
|
|
|
} |
|
69
|
|
|
} |
|
70
|
|
|
|