Doctrine\DBAL\Statement::fetchAll PHP Метод

fetchAll() публичный Метод

Returns an array containing all of the result set rows.
public fetchAll ( integer | null $fetchMode = null, mixed $fetchArgument ) : array
$fetchMode integer | null
$fetchArgument mixed
Результат array An array containing all of the remaining rows in the result set.
    public function fetchAll($fetchMode = null, $fetchArgument = 0)
    {
        if ($fetchArgument !== 0) {
            return $this->stmt->fetchAll($fetchMode, $fetchArgument);
        }
        return $this->stmt->fetchAll($fetchMode);
    }

Usage Example

 /**
  * @param \Doctrine\DBAL\Connection $connection
  * @param \Doctrine\DBAL\Statement $stmt
  */
 function it_get_keys($connection, $stmt)
 {
     $stmt->fetchAll(\PDO::FETCH_COLUMN)->willReturn(array('filename', 'filename1', 'filename2'));
     $connection->quoteIdentifier(Argument::any())->will(function ($argument) {
         return sprintf('"%s"', $argument[0]);
     });
     $connection->executeQuery('SELECT "key" FROM "someTableName"')->willReturn($stmt);
     $this->keys()->shouldReturn(array('filename', 'filename1', 'filename2'));
 }
All Usage Examples Of Doctrine\DBAL\Statement::fetchAll