Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
database system
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Mar 2014 at 15:04 UTC
Updated:
29 Jul 2014 at 23:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
drunken monkeySo, here would be a patch to add that method. (If the test bot complains, at least we might get an idea what's wrong with doing this / why it wasn't done before.)
Comment #2
drunken monkeySeems this change is perfectly acceptable, at least as far as the test bot is concerned. So, does anyone now why this is missing?
Comment #3
nick_vhMakes total sense to have it in the interface. I also do not know of exceptions so please enlighten us or get it in :)
Let's avoid the following :

Comment #4
nick_vhComment #5
drunken monkeyJust for the record, in case someone else wonders: I noticed some other missing interface methods, in
\Drupal\Core\Database\StatementInterface. There, only half of thefetch*()methods are defined, most notablyfetch()itself is missing.The methods are there, though, just commented out, and the interface comment actually explains exactly why that was done:
However, this isn't the case here, so we are still left to wonder. (Although, since Drupal 8 won't support "versions older than 5.2.6" anyways, maybe we can change that now, too?)
Comment #6
pwolanin commentedFor the other methods, look at: #2168241: Type hints for optional methods in StatementInterface (D8) / DatabaseStatementInterface (D7)
Comment #7
Crell commentedI believe it was left off because execute() is a method on the Query base class, which all query builders extend. In hindsight, that seems like a rather stupid reason. :-)
This is *probably* D7-backport-safe. (It only would break on a select object that doesn't implement execute(), which would already be pointless).
Comment #8
donquixote commented@Crell:
The reason why this will make problems in D7 for PHP 5.3.8 and older:
http://3v4l.org/5T5vv
http://stackoverflow.com/questions/17525620/php-fatal-error-cant-inherit...
https://bugs.php.net/bug.php?id=43200
Comment #9
Crell commentedSigh PHP...
Comment #10
donquixote commentedBtw, DatabaseStatement::execute() is already covered in the other issue #2168241: Type hints for optional methods in StatementInterface (D8) / DatabaseStatementInterface (D7) (although not exactly like here), but this other issue is doing too many things at once. So probably a good idea to get this in first, and then slice up the other issue into smaller ones.
Comment #11
catchCommitted/pushed to 8.x, thanks!
Comment #13
donquixote commentedWhat about http://3v4l.org/viggJ