diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:31:33 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:31:33 -0400 |
commit | 150f94f051128f367bc89f6b7e5f57eb2a69fc62 (patch) | |
tree | 181f454813b310ee97385058c6c6f2e3f34d5fd8 /vendor/ruflin/elastica/lib/Elastica/Filter/Query.php | |
parent | 7e85254903c7c0cb49e381f16b18441ea7b058cc (diff) | |
parent | 80f7dc77d430774192b929d780f96260066df2ee (diff) |
Merge commit '80f7dc'
# Conflicts:
# extensions/ArchInterWiki.sql
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Filter/Query.php')
-rw-r--r-- | vendor/ruflin/elastica/lib/Elastica/Filter/Query.php | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Filter/Query.php b/vendor/ruflin/elastica/lib/Elastica/Filter/Query.php deleted file mode 100644 index 3f1ba2d2..00000000 --- a/vendor/ruflin/elastica/lib/Elastica/Filter/Query.php +++ /dev/null @@ -1,90 +0,0 @@ -<?php - -namespace Elastica\Filter; - -use Elastica\Exception\InvalidException; -use Elastica\Query\AbstractQuery; - -/** - * Query filter - * - * @category Xodoa - * @package Elastica - * @author Nicolas Ruflin <spam@ruflin.com> - * @link http://www.elasticsearch.org/guide/reference/query-dsl/query-filter.html - */ -class Query extends AbstractFilter -{ - /** - * Query - * @var array - */ - protected $_query; - - /** - * Construct query filter - * - * @param array|\Elastica\Query\AbstractQuery $query - */ - public function __construct($query = null) - { - if (!is_null($query)) { - $this->setQuery($query); - } - } - - /** - * Set query - * - * @param array|\Elastica\Query\AbstractQuery $query - * @return \Elastica\Filter\Query Query object - * @throws \Elastica\Exception\InvalidException Invalid param - */ - public function setQuery($query) - { - if (!$query instanceof AbstractQuery && ! is_array($query)) { - throw new InvalidException('expected an array or instance of Elastica\Query\AbstractQuery'); - } - - if ($query instanceof AbstractQuery) { - $query = $query->toArray(); - } - - $this->_query = $query; - - return $this; - } - - /** - * @see \Elastica\Param::_getBaseName() - */ - protected function _getBaseName() - { - if (empty($this->_params)) { - return 'query'; - } else { - return 'fquery'; - } - } - - /** - * @see \Elastica\Param::toArray() - */ - public function toArray() - { - $data = parent::toArray(); - - $name = $this->_getBaseName(); - $filterData = $data[$name]; - - if (empty($filterData)) { - $filterData = $this->_query; - } else { - $filterData['query'] = $this->_query; - } - - $data[$name] = $filterData; - - return $data; - } -} |