0

My eclipse(Zend Studio 12) keeps showing an error in the source code of Drupal's database API that the class DatabaseStatementBase implements the interface DatabaseStatementInterface, but does not implement the abstract method DatabaseStatementInterface.rowCount().

I am talking about Line#2137 of: /includes/database/database.inc

I was wondering if this is a bug in Drupal or left out intentionally for some design reasons? Or some problem in my Zend Studio setup?

And how it is possible that DatabaseStatementBase is not defined as an abstract class while it is not implementing this abstract method DatabaseStatementInterface.rowCount(), and still no fatal errors raised.

rineez
  • 753
  • 13
  • 33

1 Answers1

1

It's not a bug, DatabaseStatementBase simply doesn't need to implement rowCount.

It extends PDOStatement, which does:

PDOStatement::rowCount.

Clive
  • 36,918
  • 8
  • 87
  • 113
  • I see! So, can we call that a bug in Zend Studio? Or is it just something wrong with my Zend studio settings? – rineez Nov 23 '14 at 05:26
  • May be I should have asked the question differently and tagged this as a zend studio related thing? – rineez Nov 23 '14 at 05:32
  • This answer is good, but I updated my question to be more informative. It would be great if the answer also could be updated accordingly. – rineez Nov 23 '14 at 05:49
  • The question looks the same to me, what more information were you hoping I can give you? I couldn't tell you if this is a bug with Zend or its configuration (I use PHPStorm which is smart enough to resolve the dependency correctly). The rest of the question is already answered by the fact that `rowCount` _is_ implemented by `DatabaseStatementBase`, albeit indirectly – Clive Nov 23 '14 at 11:33
  • 1
    Thanks. I edited the question because your answer made me realize that this error I saw is more of an IDE related thing than anything to do with Drupal. My original question was just assuming that the error is a real problem in Drupal and never mentioned anything about the IDE I used. I hope some Zend studio user will show up and add some info. – rineez Nov 24 '14 at 11:43