Cassandra\Session::execute PHP Method

execute() public method

Executes a given statement and returns a result.
public execute ( cassandra\Statement $statement, ExecutionOptions $options = null ) : Rows
$statement cassandra\Statement statement to be executed
$options ExecutionOptions execution options (optional)
return Rows execution result
    public function execute(Statement $statement, ExecutionOptions $options = null);

Usage Example

Example #1
0
 /**
  * Accepts a query string
  *
  * @param string $queryString            
  * @param bool $throw            
  * @throws ApiException
  * @return Cassandra\Rows
  */
 public function query($queryString, $throw = false)
 {
     if (empty($this->cluster) || empty($this->session)) {
         throw new ApiException('Query failure - missing connection stream');
     }
     $query = new Cassandra\SimpleStatement($queryString);
     try {
         $result = $this->session->execute($query);
         return $result;
     } catch (\Cassandra\Exception\RuntimeException $e) {
         LogException::e($e);
         if ($throw) {
             throw new ApiException('Query Failure', r_server);
         }
     }
 }
All Usage Examples Of Cassandra\Session::execute