cursor() public method

Run a select statement against the database and returns a generator.
public cursor ( string $query, array $bindings = [], boolean $useReadPdo = true ) : Generator
$query string
$bindings array
$useReadPdo boolean
return Generator
Example #1
0
 /**
  * Get a generator for the given query.
  *
  * @return \Generator
  */
 public function cursor()
 {
     if (is_null($this->columns)) {
         $this->columns = ['*'];
     }
     return $this->connection->cursor($this->toSql(), $this->getBindings(), !$this->useWritePdo);
 }