1: <?php
2:
3: namespace vierbergenlars\Forage\SearchResult;
4:
5: /**
6: * A facet
7: */
8: class Facet extends \ArrayObject
9: {
10: /**
11: * The name of the faceted field
12: *
13: * @var string
14: */
15: protected $field;
16:
17: /**
18: * Creates a new facet
19: *
20: * @private
21: * @param string $field
22: * @param array $results
23: */
24: public function __construct($field, $results)
25: {
26: $this->field = $field;
27: parent::__construct($results);
28: }
29:
30: /**
31: * Gets the name of the faceted field
32: *
33: * @return string
34: */
35: public function getField()
36: {
37: return $this->field;
38: }
39:
40: /**
41: * Gets the results of the faceted field
42: *
43: * @return array
44: */
45: public function getResults()
46: {
47: return $this->getArrayCopy();
48: }
49: }
50: