You are here

protected function MySQLiSource::_fetchAssoc in Backup and Migrate 5.0.x

Return the first result of the query as an associated array.

Parameters

string $query: A SQL query.

Return value

array

Throws

\Exception

2 calls to MySQLiSource::_fetchAssoc()
MySQLiSource::_fetchValue in src/Core/Source/MySQLiSource.php
Return the first field of the first result of a query.
MySQLiSource::_getTableCreateSql in src/Core/Source/MySQLiSource.php
Get the sql for the structure of the given table.

File

src/Core/Source/MySQLiSource.php, line 473

Class

MySQLiSource
@package Drupal\backup_migrate\Core\Source

Namespace

Drupal\backup_migrate\Core\Source

Code

protected function _fetchAssoc($query) {
  $result = $this
    ->query($query);
  if ($result) {
    return $result
      ->fetch_assoc();
  }
  return [];
}