1<?php 2 3namespace Elastica\Query; 4 5/** 6 * Simple query 7 * Pure php array query. Can be used to create any not existing type of query. 8 * 9 * @author Nicolas Ruflin <spam@ruflin.com> 10 */ 11class Simple extends AbstractQuery 12{ 13 /** 14 * Query. 15 * 16 * @var array Query 17 */ 18 protected $_query = []; 19 20 public function __construct(array $query) 21 { 22 $this->setQuery($query); 23 } 24 25 /** 26 * Sets new query array. 27 * 28 * @param array $query Query array 29 * 30 * @return $this 31 */ 32 public function setQuery(array $query): self 33 { 34 $this->_query = $query; 35 36 return $this; 37 } 38 39 /** 40 * {@inheritdoc} 41 */ 42 public function toArray(): array 43 { 44 return $this->_query; 45 } 46} 47