summaryrefslogtreecommitdiff
path: root/vendor/ruflin/elastica/lib/Elastica/Query/Simple.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Query/Simple.php')
-rw-r--r--vendor/ruflin/elastica/lib/Elastica/Query/Simple.php54
1 files changed, 54 insertions, 0 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Query/Simple.php b/vendor/ruflin/elastica/lib/Elastica/Query/Simple.php
new file mode 100644
index 00000000..6ba9310d
--- /dev/null
+++ b/vendor/ruflin/elastica/lib/Elastica/Query/Simple.php
@@ -0,0 +1,54 @@
+<?php
+namespace Elastica\Query;
+
+/**
+ * Simple query
+ * Pure php array query. Can be used to create any not existing type of query.
+ *
+ * @author Nicolas Ruflin <spam@ruflin.com>
+ */
+class Simple extends AbstractQuery
+{
+ /**
+ * Query.
+ *
+ * @var array Query
+ */
+ protected $_query = array();
+
+ /**
+ * Constructs a query based on an array.
+ *
+ * @param array $query Query array
+ */
+ public function __construct(array $query)
+ {
+ $this->setQuery($query);
+ }
+
+ /**
+ * Sets new query array.
+ *
+ * @param array $query Query array
+ *
+ * @return $this
+ */
+ public function setQuery(array $query)
+ {
+ $this->_query = $query;
+
+ return $this;
+ }
+
+ /**
+ * Converts query to array.
+ *
+ * @return array Query array
+ *
+ * @see \Elastica\Query\AbstractQuery::toArray()
+ */
+ public function toArray()
+ {
+ return $this->_query;
+ }
+}