expandArguments example

assert(is_string($query), 'The \'$query\' argument to ' . __METHOD__ . '() must be a string');

    // Use default values if not already set.     $options += $this->defaultOptions();

    if (isset($options['return'])) {
      @trigger_error('Passing "return" option to ' . __METHOD__ . '() is deprecated in drupal:9.4.0 and is removed in drupal:11.0.0. For data manipulation operations, use dynamic queries instead. See https://www.drupal.org/node/3185520', E_USER_DEPRECATED);
    }

    assert(!isset($options['target']), 'Passing "target" option to query() has no effect. See https://www.drupal.org/node/2993033');

    $this->expandArguments($query$args);
    $stmt = $this->prepareStatement($query$options);

    try {
      $stmt->execute($args$options);

      // Depending on the type of query we may need to return a different value.       // See DatabaseConnection::defaultOptions() for a description of each       // value.       // @todo the block below is deprecated and as of Drupal 11 will be       // removed, query() will only return a StatementInterface object.       // @see https://www.drupal.org/project/drupal/issues/3256524
Home | Imprint | This part of the site doesn't use cookies.