From a1789ddde42033f1b05cc4929491214ee6e79383 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 17 Dec 2015 09:15:42 +0100 Subject: Update to MediaWiki 1.26.0 --- .../lib/Elastica/Aggregation/ReverseNested.php | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 vendor/ruflin/elastica/lib/Elastica/Aggregation/ReverseNested.php (limited to 'vendor/ruflin/elastica/lib/Elastica/Aggregation/ReverseNested.php') diff --git a/vendor/ruflin/elastica/lib/Elastica/Aggregation/ReverseNested.php b/vendor/ruflin/elastica/lib/Elastica/Aggregation/ReverseNested.php new file mode 100644 index 00000000..5216ae85 --- /dev/null +++ b/vendor/ruflin/elastica/lib/Elastica/Aggregation/ReverseNested.php @@ -0,0 +1,49 @@ +setPath($path); + } + } + + /** + * Set the nested path for this aggregation. + * + * @param string $path + * + * @return $this + */ + public function setPath($path) + { + return $this->setParam('path', $path); + } + + /** + * {@inheritDoc} + */ + public function toArray() + { + $array = parent::toArray(); + + // ensure we have an object for the reverse_nested key. + // if we don't have a path, then this would otherwise get encoded as an empty array, which is invalid. + $array['reverse_nested'] = (object) $array['reverse_nested']; + + return $array; + } +} -- cgit v1.2.3-54-g00ecf