move method and added warning on count function
authorJeroen De Dauw <jeroendedauw@users.mediawiki.org>
Tue, 14 Feb 2012 22:27:07 +0000 (22:27 +0000)
committerJeroen De Dauw <jeroendedauw@users.mediawiki.org>
Tue, 14 Feb 2012 22:27:07 +0000 (22:27 +0000)
includes/DBDataObject.php
includes/DBTable.php

index 25b653f..3fa5285 100644 (file)
@@ -551,19 +551,6 @@ abstract class DBDataObject {
                $this->readDb = $db;
        }
 
-       /**
-        * Gets if the object can take a certain field.
-        *
-        * @since 1.20
-        *
-        * @param string $name
-        *
-        * @return boolean
-        */
-       public function canHaveField( $name ) {
-               return array_key_exists( $name, $this->table->getFieldTypes() );
-       }
-
        /**
         * Add an amount (can be negative) to the specified field (needs to be numeric).
         *
index 70bbc0d..7d17b54 100644 (file)
@@ -266,6 +266,9 @@ abstract class DBTable {
         * Returns the amount of matching records.
         * Condition field names get prefixed.
         *
+        * Note that this can be expensive on large tables.
+        * In such cases you might want to use DatabaseBase::estimateRowCount instead.
+        *
         * @since 1.20
         *
         * @param array $conditions
@@ -600,5 +603,18 @@ abstract class DBTable {
        public function getFieldNames() {
                return array_keys( $this->getFieldTypes() );
        }
+
+       /**
+        * Gets if the object can take a certain field.
+        *
+        * @since 1.20
+        *
+        * @param string $name
+        *
+        * @return boolean
+        */
+       public function canHaveField( $name ) {
+               return array_key_exists( $name, $this->getFieldTypes() );
+       }
        
 }