Output of the "Running raw SQL queries with Doctrine" Doctrine snippet

Environment:

  • Strangebuzz Snippet VM: 4.0.0
  • Symfony: 6.4.1

Code execution output:

-- $statement->fetchAllAssociative() --
SELECT type, count(*) AS count FROM article WHERE id > ? GROUP BY type

array(2) {
  [0]=>
  array(2) {
    ["type"]=>
    string(9) "blog_post"
    ["count"]=>
    int(35)
  }
  [1]=>
  array(2) {
    ["type"]=>
    string(7) "snippet"
    ["count"]=>
    int(229)
  }
}
-- $this->connection->fetchAllAssociative() --
SELECT type, count(*) AS count FROM article GROUP BY type

array(2) {
  [0]=>
  array(2) {
    ["type"]=>
    string(9) "blog_post"
    ["count"]=>
    int(38)
  }
  [1]=>
  array(2) {
    ["type"]=>
    string(7) "snippet"
    ["count"]=>
    int(246)
  }
}
-- $this->entityManager->createNativeQuery() --
array(2) {
  [0]=>
  array(2) {
    ["type"]=>
    string(9) "blog_post"
    ["count"]=>
    int(38)
  }
  [1]=>
  array(2) {
    ["type"]=>
    string(7) "snippet"
    ["count"]=>
    int(246)
  }
}