You are here

public function FrxPDO::searchTables in Forena Reports 8

Method to return an array of tables that start with the string indicated in $str

Parameters

string $str : Partial table Name to search.

Return value

array Array of tables to search. :

Overrides DriverBase::searchTables

File

src/FrxPlugin/Driver/FrxPDO.php, line 249
General database engine used to do sql queries.

Class

FrxPDO
Class FrxPDO

Namespace

Drupal\forena\FrxPlugin\Driver

Code

public function searchTables($str) {
  $str .= '%';
  $sql = $this
    ->searchTablesSQL();
  if ($sql) {
    $st = $this->db
      ->prepare($sql);
    if ($st) {
      $st
        ->execute(array(
        ':str' => $str,
      ));
    }
    if ($st) {
      return $st
        ->fetchAll(\PDO::FETCH_COLUMN, 0);
    }
    else {
      return NULL;
    }
  }
  else {
    return NULL;
  }
}