diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-12-20 09:00:55 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-12-20 09:00:55 +0100 |
commit | a2190ac74dd4d7080b12bab90e552d7aa81209ef (patch) | |
tree | 8b31f38de9882d18df54cf8d9e0de74167a094eb /vendor/ruflin/elastica/lib/Elastica/Facet/AbstractFacet.php | |
parent | 15e69f7b20b6596b9148030acce5b59993b95a45 (diff) | |
parent | 257401d8b2cf661adf36c84b0e3fd1cf85e33c22 (diff) |
Merge branch 'mw-1.26'
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Facet/AbstractFacet.php')
-rw-r--r-- | vendor/ruflin/elastica/lib/Elastica/Facet/AbstractFacet.php | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Facet/AbstractFacet.php b/vendor/ruflin/elastica/lib/Elastica/Facet/AbstractFacet.php index 25cee812..743cefe1 100644 --- a/vendor/ruflin/elastica/lib/Elastica/Facet/AbstractFacet.php +++ b/vendor/ruflin/elastica/lib/Elastica/Facet/AbstractFacet.php @@ -1,30 +1,27 @@ <?php - namespace Elastica\Facet; -use Elastica\Param; -use Elastica\Filter\AbstractFilter; use Elastica\Exception\InvalidException; +use Elastica\Filter\AbstractFilter; +use Elastica\Param; /** - * Abstract facet object. Should be extended by all facet types + * Abstract facet object. Should be extended by all facet types. * - * @category Xodoa - * @package Elastica * @author Nicolas Ruflin <spam@ruflin.com> * @author Jasper van Wanrooy <jasper@vanwanrooy.net> + * + * @deprecated Facets are deprecated and will be removed in a future release. You are encouraged to migrate to aggregations instead. */ abstract class AbstractFacet extends Param { /** - * Holds the name of the facet. - * @var string + * @var string Holds the name of the facet. */ protected $_name = ''; /** - * Holds all facet parameters. - * @var array + * @var array Holds all facet parameters. */ protected $_facet = array(); @@ -42,9 +39,11 @@ abstract class AbstractFacet extends Param * Sets the name of the facet. It is automatically set by * the constructor. * - * @param string $name The name of the facet. - * @throws \Elastica\Exception\InvalidException - * @return \Elastica\Facet\AbstractFacet + * @param string $name The name of the facet. + * + * @throws \Elastica\Exception\InvalidException If name is empty + * + * @return $this */ public function setName($name) { @@ -69,8 +68,9 @@ abstract class AbstractFacet extends Param /** * Sets a filter for this facet. * - * @param \Elastica\Filter\AbstractFilter $filter A filter to apply on the facet. - * @return \Elastica\Facet\AbstractFacet + * @param \Elastica\Filter\AbstractFilter $filter A filter to apply on the facet. + * + * @return $this */ public function setFilter(AbstractFilter $filter) { @@ -82,8 +82,9 @@ abstract class AbstractFacet extends Param * current search query. When not set, it defaults to the * Elasticsearch default value. * - * @param bool $global Flag to either run the facet globally. - * @return \Elastica\Facet\AbstractFacet + * @param bool $global Flag to either run the facet globally. + * + * @return $this */ public function setGlobal($global = true) { @@ -91,10 +92,11 @@ abstract class AbstractFacet extends Param } /** - * Sets the path to the nested document + * Sets the path to the nested document. * - * @param string $nestedPath Nested path - * @return \Elastica\Facet\AbstractFacet + * @param string $nestedPath Nested path + * + * @return $this */ public function setNested($nestedPath) { @@ -102,10 +104,11 @@ abstract class AbstractFacet extends Param } /** - * Sets the scope + * Sets the scope. + * + * @param string $scope Scope * - * @param string $scope Scope - * @return \Elastica\Facet\AbstractFacet + * @return $this */ public function setScope($scope) { @@ -128,9 +131,10 @@ abstract class AbstractFacet extends Param * Sets a param for the facet. Each facet implementation needs to take * care of handling their own params. * - * @param string $key The key of the param to set. - * @param mixed $value The value of the param. - * @return \Elastica\Facet\AbstractFacet + * @param string $key The key of the param to set. + * @param mixed $value The value of the param. + * + * @return $this */ protected function _setFacetParam($key, $value) { |