https://www.mediawiki.org/wiki/Special:Code/MediaWiki/111502

Revision: 111502
Author:   jeroendedauw
Date:     2012-02-14 22:27:07 +0000 (Tue, 14 Feb 2012)
Log Message:
-----------
move method and added warning on count function

Modified Paths:
--------------
    trunk/phase3/includes/DBDataObject.php
    trunk/phase3/includes/DBTable.php

Modified: trunk/phase3/includes/DBDataObject.php
===================================================================
--- trunk/phase3/includes/DBDataObject.php      2012-02-14 22:04:10 UTC (rev 
111501)
+++ trunk/phase3/includes/DBDataObject.php      2012-02-14 22:27:07 UTC (rev 
111502)
@@ -552,19 +552,6 @@
        }
 
        /**
-        * 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).
         *
         * @since 1.20

Modified: trunk/phase3/includes/DBTable.php
===================================================================
--- trunk/phase3/includes/DBTable.php   2012-02-14 22:04:10 UTC (rev 111501)
+++ trunk/phase3/includes/DBTable.php   2012-02-14 22:27:07 UTC (rev 111502)
@@ -266,6 +266,9 @@
         * 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 @@
        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() );
+       }
        
 }


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to