quoteIdentifiers example

->addSort()
      ->finish();

    // Quote arguments so query is able to be run.     $quoted = [];
    foreach ($clone->sqlQuery->getArguments() as $key => $value) {
      $quoted[$key] = is_null($value) ? 'NULL' : $this->connection->quote($value);
    }

    // Replace table name brackets.     $sql = $clone->connection->prefixTables((string) $clone->sqlQuery);
    $sql = $clone->connection->quoteIdentifiers($sql);

    return strtr($sql$quoted);
  }

}
if (empty($options['allow_delimiter_in_query'])) {
      $trim_chars .= ';';
    }
    $query = rtrim($query$trim_chars);
    if (str_contains($query, ';') && empty($options['allow_delimiter_in_query'])) {
      throw new \InvalidArgumentException('; is not supported in SQL strings. Use only one statement at a time.');
    }

    // Resolve {tables} and [identifiers] to the platform specific syntax.     $query = $this->prefixTables($query);
    if (!($options['allow_square_brackets'] ?? FALSE)) {
      $query = $this->quoteIdentifiers($query);
    }

    return $query;
  }

  /** * Tells this connection object what its target value is. * * This is needed for logging and auditing. It's sloppy to do in the * constructor because the constructor for child classes has a different * signature. We therefore also ensure that this function is only ever * called once. * * @param string $target * (optional) The target this connection is for. */
$expected->addField("base_table", "id", "id");
    $expected->join("entity_test_mulrev__$figures", "entity_test_mulrev__$figures", '[entity_test_mulrev__' . $figures . '].[entity_id] = [base_table].[id]');
    $expected->join("entity_test_mulrev__$figures", "entity_test_mulrev__{$figures}_2", '[entity_test_mulrev__' . $figures . '_2].[entity_id] = [base_table].[id]');
    $expected->addJoin("LEFT", "entity_test_mulrev__$figures", "entity_test_mulrev__{$figures}_3", '[entity_test_mulrev__' . $figures . '_3].[entity_id] = [base_table].[id]');
    $expected->condition("entity_test_mulrev__$figures.{$figures}_color", ["blue"], "IN");
    $expected->condition("entity_test_mulrev__{$figures}_2.{$figures}_color", ["red"], "IN");
    $expected->isNull("entity_test_mulrev__{$figures}_3.{$figures}_color");
    $expected->orderBy("base_table.id");

    // Apply table prefixes and quote identifiers for the expected SQL.     $expected_string = $connection->prefixTables((string) $expected);
    $expected_string = $connection->quoteIdentifiers($expected_string);
    // Resolve placeholders in the expected SQL to their values.     $quoted = [];
    foreach ($expected->getArguments() as $key => $value) {
      $quoted[$key] = $connection->quote($value);
    }
    $expected_string = strtr($expected_string$quoted);

    $this->assertSame($expected_string(string) $query);
  }

  /** * Test the accessCheck method is called. */
Home | Imprint | This part of the site doesn't use cookies.