FakeStatement doesn't behaves as same as Statement

Created on 12 November 2014, about 10 years ago
Updated 10 February 2023, almost 2 years ago

Problem/Motivation

    $query = $connection->select('users_data', 'ud')
      ->fields('ud')
      ->condition('module', $module);
    foreach ($result as $item) {
      print_r($item);
    }
// $item is object if the connection is Drupal\Core\Database\Connection
stdClass Object
(
    [uid] => 1
    [module] => foo
    [name] => bar
    [value] => baz
    [serialized] => 0
)

$item is array if the connection is Drupal\Core\Database\Driver\fake\FakeConnection.





Proposed resolution

Support PDO::FETCH_OBJ. Throw exceptions for crazy class fetch modes.

Remaining tasks

User interface changes

API changes

🐛 Bug report
Status

Closed: works as designed

Version

9.5

Component
Database 

Last updated 2 days ago

  • Maintained by
  • 🇳🇱Netherlands @daffie
Created by

🇬🇧United Kingdom vijaycs85 London, UK

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇿New Zealand quietone

    There is not much discussion here in either years and in #2 it is suggested that making a change is not worth it. More information was asked for 7 months ago and none has been provided. I think it is time to close this one.

Production build 0.71.5 2024