You are here

public function InstapageCmsPluginDrupal8Connector::getResults in Instapage plugin 8.3

Same name and namespace in other branches
  1. 7.3 core/connectors/InstapageCmsPluginDrupal8Connector.php \InstapageCmsPluginDrupal8Connector::getResults()

Executes the query and returns a list of results.

Parameters

string $sql SQL to execute. %s can be used to output pre-formatted values. Values for %s can be passed as arguments for this function.:

Return value

mixed Array of results, false on error.

2 calls to InstapageCmsPluginDrupal8Connector::getResults()
InstapageCmsPluginDrupal8Connector::getPostSlugs in core/connectors/InstapageCmsPluginDrupal8Connector.php
Gets the list of slugs used by Drupal 8 posts.
InstapageCmsPluginDrupal8Connector::isProhibitedPostSlug in core/connectors/InstapageCmsPluginDrupal8Connector.php
Checks if given slug is prohibited in terms of publishing a landing page. If it's free - will return false. Otherwise an array with slug details will be returned

File

core/connectors/InstapageCmsPluginDrupal8Connector.php, line 182

Class

InstapageCmsPluginDrupal8Connector
Class that utilizes native Drupal 8 functions to perform actions like remote requests and DB operations.

Code

public function getResults($sql) {
  $args = func_get_args();
  array_shift($args);
  $args = $this
    ->prepareFunctionArgs($args);
  try {
    $statement = $this
      ->prepare($sql);
    if (count($args)) {
      $statement
        ->execute($args);
    }
    else {
      $statement
        ->execute();
    }
    return $statement
      ->fetchAll(PDO::FETCH_OBJ);
  } catch (Exception $e) {
    $this
      ->logDbError($e, $sql);
    return false;
  }
}