Doctrine\DBAL\Statement::fetch PHP Method

fetch() public method

Fetches the next row from a result set.
public fetch ( integer | null $fetchMode = null ) : mixed
$fetchMode integer | null
return mixed The return value of this function on success depends on the fetch type. In all cases, FALSE is returned on failure.
    public function fetch($fetchMode = null)
    {
        return $this->stmt->fetch($fetchMode);
    }

Usage Example

Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function rewind()
 {
     if (null === $this->stmt) {
         $this->stmt = $this->prepare($this->sql, $this->params);
     }
     if (0 !== $this->key) {
         $this->stmt->execute();
         $this->data = $this->stmt->fetch(\PDO::FETCH_ASSOC);
         $this->key = 0;
     }
 }
All Usage Examples Of Doctrine\DBAL\Statement::fetch