From 15e69f7b20b6596b9148030acce5b59993b95a45 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 18 Dec 2015 06:00:00 +0100 Subject: Update to MediaWiki 1.25.4 --- .../elastica/lib/Elastica/Filter/HasParent.php | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 vendor/ruflin/elastica/lib/Elastica/Filter/HasParent.php (limited to 'vendor/ruflin/elastica/lib/Elastica/Filter/HasParent.php') diff --git a/vendor/ruflin/elastica/lib/Elastica/Filter/HasParent.php b/vendor/ruflin/elastica/lib/Elastica/Filter/HasParent.php new file mode 100644 index 00000000..de49e470 --- /dev/null +++ b/vendor/ruflin/elastica/lib/Elastica/Filter/HasParent.php @@ -0,0 +1,77 @@ +setFilter($query); + } else { + $this->setQuery($query); + } + $this->setType($type); + } + + /** + * Sets query object + * + * @param string|\Elastica\Query|\Elastica\Query\AbstractQuery $query + * @return \Elastica\Filter\HasParent Current object + */ + public function setQuery($query) + { + $query = \Elastica\Query::create($query); + $data = $query->toArray(); + + return $this->setParam('query', $data['query']); + } + + /** + * Sets query object + * + * @param \Elastica\Filter\AbstractFilter $filter + * @return \Elastica\Filter\HasParent Current object + */ + public function setFilter($filter) + { + $data = $filter->toArray(); + return $this->setParam('filter', $data); + } + + /** + * Set type of the parent document + * + * @param string $type Parent document type + * @return \Elastica\Filter\HasParent Current object + */ + public function setType($type) + { + return $this->setParam('type', $type); + } + + /** + * Sets the scope + * + * @param string $scope Scope + * @return \Elastica\Filter\HasParent Current object + */ + public function setScope($scope) + { + return $this->setParam('_scope', $scope); + } +} -- cgit v1.2.3-54-g00ecf