Doctrine\DBAL\Statement::setFetchMode PHP Method

setFetchMode() public method

public setFetchMode ( $fetchMode, $arg2 = null, $arg3 = null )
    public function setFetchMode($fetchMode, $arg2 = null, $arg3 = null)
    {
        if ($arg2 === null) {
            return $this->stmt->setFetchMode($fetchMode);
        } elseif ($arg3 === null) {
            return $this->stmt->setFetchMode($fetchMode, $arg2);
        }
        return $this->stmt->setFetchMode($fetchMode, $arg2, $arg3);
    }

Usage Example

Example #1
0
 /**
  * Prepares an SQL statement.
  *
  * @param string $statement The SQL statement to prepare.
  * @return \Doctrine\DBAL\Driver\Statement The prepared statement.
  */
 public function prepare($statement)
 {
     $this->connect();
     $stmt = new Statement($statement, $this);
     $stmt->setFetchMode($this->_defaultFetchMode);
     return $stmt;
 }
All Usage Examples Of Doctrine\DBAL\Statement::setFetchMode