dbal: FetchMode::GROUP, FetchMode::UNIQUE are missing

BC Break Report

Q A
BC Break yes
Version 2.7

Summary

My code spits this: PHP Deprecated: Using a PDO fetch mode or their combination (196610 given) is deprecated and will cause an error in Doctrine DBAL 3.0, so I’m trying to upgrade

This should be the part where my code is unfit:

$stmt->fetchAll(\PDO::FETCH_GROUP|\PDO::FETCH_UNIQUE|\PDO::FETCH_ASSOC)

As suggested in the upgrade.MD, I tried to replace it with this:

$stmt->fetchAll(FetchMode::GROUP|FetchMode::UNIQUE|FetchMode::ASSOCIATIVE)

But it doesn’t work, because the FetchMode class doesn’t define neither FetchMode::GROUP nor FetchMode::UNIQUE

What am I missing here?

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19 (7 by maintainers)

Most upvoted comments

Anyway, I think this is a stupid decision. If you don’t want to support, leave it, don’t touch it. And then people used it and suddenly everything was deleted.

I agree - PDO is a fairly solid system already and offers this. Why block it unnecessarily just because it may not work for everyone? With no workaround or better offering? It’s just making your software less functional.