* @author Timo Hund */ abstract class AbstractFacetItem { /** * @var string */ protected $label = ''; /** * @var int */ protected $documentCount = 0; /** * @var bool */ protected $selected = false; /** * @var array */ protected $metrics = []; /** * @var AbstractFacet */ protected $facet; /** * @param AbstractFacet $facet * @param string $label * @param int $documentCount * @param bool $selected * @param array $metrics */ public function __construct(AbstractFacet $facet, $label = '', $documentCount = 0, $selected = false, $metrics = []) { $this->facet = $facet; $this->label = $label; $this->documentCount = $documentCount; $this->selected = $selected; $this->metrics = $metrics; } /** * @return int */ public function getDocumentCount() { return $this->documentCount; } /** * @return \WapplerSystems\Meilisearch\Domain\Search\ResultSet\Facets\AbstractFacet */ public function getFacet() { return $this->facet; } /** * @return string */ public function getLabel() { return $this->label; } /** * @return boolean */ public function getSelected() { return $this->selected; } /** * @return array */ public function getMetrics() { return $this->metrics; } /** * @return string */ abstract public function getUriValue(); /** * @return string */ abstract function getCollectionKey(); }