r111502 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111501‎ | r111502 | r111503 >
Date:22:27, 14 February 2012
Author:jeroendedauw
Status:reverted
Tags:
Comment:
move method and added warning on count function
Modified paths:
  • /trunk/phase3/includes/DBDataObject.php (modified) (history)
  • /trunk/phase3/includes/DBTable.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DBDataObject.php
@@ -552,19 +552,6 @@
553553 }
554554
555555 /**
556 - * Gets if the object can take a certain field.
557 - *
558 - * @since 1.20
559 - *
560 - * @param string $name
561 - *
562 - * @return boolean
563 - */
564 - public function canHaveField( $name ) {
565 - return array_key_exists( $name, $this->table->getFieldTypes() );
566 - }
567 -
568 - /**
569556 * Add an amount (can be negative) to the specified field (needs to be numeric).
570557 *
571558 * @since 1.20
Index: trunk/phase3/includes/DBTable.php
@@ -266,6 +266,9 @@
267267 * Returns the amount of matching records.
268268 * Condition field names get prefixed.
269269 *
 270+ * Note that this can be expensive on large tables.
 271+ * In such cases you might want to use DatabaseBase::estimateRowCount instead.
 272+ *
270273 * @since 1.20
271274 *
272275 * @param array $conditions
@@ -600,5 +603,18 @@
601604 public function getFieldNames() {
602605 return array_keys( $this->getFieldTypes() );
603606 }
 607+
 608+ /**
 609+ * Gets if the object can take a certain field.
 610+ *
 611+ * @since 1.20
 612+ *
 613+ * @param string $name
 614+ *
 615+ * @return boolean
 616+ */
 617+ public function canHaveField( $name ) {
 618+ return array_key_exists( $name, $this->getFieldTypes() );
 619+ }
604620
605621 }

Status & tagging log