Implement Countable.
authorJan Schneider <jan@horde.org>
Fri, 28 Aug 2009 21:08:31 +0000 (23:08 +0200)
committerJan Schneider <jan@horde.org>
Fri, 28 Aug 2009 21:08:31 +0000 (23:08 +0200)
framework/Db/lib/Horde/Db/Adapter/Abstract.php

index 9bcea39..9e05608 100644 (file)
@@ -21,7 +21,7 @@
  * @package    Horde_Db
  * @subpackage Adapter
  */
-abstract class Horde_Db_Adapter_Abstract
+abstract class Horde_Db_Adapter_Abstract implements Countable
 {
     /**
      * Config options
@@ -472,6 +472,16 @@ abstract class Horde_Db_Adapter_Abstract
     }
 
     /**
+     * Returns the number of affected or returned rows of the last query.
+     *
+     * @return integer
+     */
+    public function count()
+    {
+        return $this->_rowCount;
+    }
+
+    /**
      * Check if a transaction has been started
      */
     public function transactionStarted()