/**
* Sends SQL statements to the database server returning the success state.
* Use this method only when the SQL statement sent to the server doesn't return any rows
* @param string $cqlStatement - CQL statement
* @param array $bindParams - bind parameters, default null
* @param array $bindTypes - bind types, default null
* @return bool
* @throws \PhalconCassandra\Db\Exception\Cassandra
*/
public function execute($cqlStatement, $bindParams = null, $bindTypes = null)
{
$statement = $this->_prepareStatement($cqlStatement, $bindParams, $bindTypes);
if ($this->_transactionLevel) {
$this->_batch->add($statement, $bindParams);
} else {
$params = ['consistency' => $this->getConsistency()];
if ($bindParams) {
$params['arguments'] = $bindParams;
}
try {
$this->_session->execute($statement, new ExecutionOptions($params));
} catch (BaseException $e) {
throw new CException($e->getMessage(), $e->getCode());
}
}
$this->_affectedRows = 1;
if ($this->_eventsManager instanceof ManagerInterface) {
$this->_eventsManager->fire('db:afterQuery', $this, $bindParams);
}
$this->_consistency = null;
return true;
}