/** * Set the query string. * * This overwrites the current value * * @param string $query * @param array $bind Bind values for placeholders in the query string * * @return self Provides fluent interface */ public function setQuery($query, $bind = null) { if (!is_null($bind)) { $helper = new Helper(); $query = $helper->assemble($query, $bind); } return $this->setOption('query', $query); }
public function build() { if (!empty($this->parameters)) { $helper = new Helper(); return $helper->assemble($this->query, $this->parameters); } return $this->query; }
public function testAssembleInvalidPartNumber() { $this->setExpectedException('Solarium\\Exception\\InvalidArgumentException'); $this->helper->assemble('cat:%1% AND content:%2%', array('value1')); }
/** * Set the query string. * * This overwrites the current value * * @param string $query * @param array $bind Bind values for placeholders in the query string * * @return self Provides fluent interface */ public function setQuery($query, $bind = null) { if (!is_null($bind)) { $helper = new Helper(); $query = $helper->assemble($query, $bind); } $this->query = trim($query); return $this; }