Clean up after r14751:
[lhc/web/wiklou.git] / includes / LinkBatch.php
index fed9359..e0f0f6f 100644 (file)
@@ -46,6 +46,20 @@ class LinkBatch {
                $this->data = $array;
        }
 
+       /**
+        * Returns true if no pages have been added, false otherwise.
+        */
+       function isEmpty() {
+               return ($this->getSize() == 0);
+       }
+
+       /**
+        * Returns the size of the batch.
+        */
+       function getSize() {
+               return count( $this->data );
+       }
+
        /**
         * Do the query and add the results to the LinkCache object
         * Return an array mapping PDBK to ID
@@ -60,7 +74,7 @@ class LinkBatch {
         * Return an array mapping PDBK to ID
         */
        function executeInto( &$cache ) {
-               $fname = 'LinkBatch::execute';
+               $fname = 'LinkBatch::executeInto';
                wfProfileIn( $fname );
                // Do query
                $res = $this->doQuery();
@@ -97,10 +111,10 @@ class LinkBatch {
         * Perform the existence test query, return a ResultWrapper with page_id fields
         */
        function doQuery() {
-               $fname = 'LinkBatch::execute';
+               $fname = 'LinkBatch::doQuery';
                $namespaces = array();
 
-               if ( !count( $this->data ) ) {
+               if ( $this->isEmpty() ) {
                        return false;
                }
                wfProfileIn( $fname );
@@ -111,6 +125,7 @@ class LinkBatch {
                $page = $dbr->tableName( 'page' );
                $set = $this->constructSet( 'page', $dbr );
                if ( $set === false ) {
+                       wfProfileOut( $fname );
                        return false;
                }
                $sql = "SELECT page_id, page_namespace, page_title FROM $page WHERE $set";
@@ -125,9 +140,9 @@ class LinkBatch {
         * Construct a WHERE clause which will match all the given titles.
         * Give the appropriate table's field name prefix ('page', 'pl', etc).
         *
-        * @param string $prefix
+        * @param $prefix String: ??
         * @return string
-        * @access public
+        * @public
         */
        function constructSet( $prefix, &$db ) {
                $first = true;