Merge "Rename SquidUpdate => CdnCacheUpdate"
[lhc/web/wiklou.git] / includes / db / DatabaseUtility.php
index 4e5ed08..7fcb68e 100644 (file)
  * @ingroup Database
  */
 
-/**
- * Utility class.
- * @ingroup Database
- */
-class DBObject {
-       public $mData;
-
-       function __construct( $data ) {
-               $this->mData = $data;
-       }
-
-       /**
-        * @return bool
-        */
-       function isLOB() {
-               return false;
-       }
-
-       function data() {
-               return $this->mData;
-       }
-}
-
 /**
  * Utility class
  * @ingroup Database
@@ -136,11 +113,11 @@ class ResultWrapper implements Iterator {
        }
 
        /**
-        * Fetch the next row from the given result object, in object form.
-        * Fields can be retrieved with $row->fieldname, with fields acting like
-        * member variables.
+        * Fetch the next row from the given result object, in object form. Fields can be retrieved with
+        * $row->fieldname, with fields acting like member variables. If no more rows are available,
+        * false is returned.
         *
-        * @return stdClass
+        * @return stdClass|bool
         * @throws DBUnexpectedError Thrown if the database returns an error
         */
        function fetchObject() {
@@ -148,10 +125,10 @@ class ResultWrapper implements Iterator {
        }
 
        /**
-        * Fetch the next row from the given result object, in associative array
-        * form. Fields are retrieved with $row['fieldname'].
+        * Fetch the next row from the given result object, in associative array form. Fields are
+        * retrieved with $row['fieldname']. If no more rows are available, false is returned.
         *
-        * @return array
+        * @return array|bool
         * @throws DBUnexpectedError Thrown if the database returns an error
         */
        function fetchRow() {
@@ -244,6 +221,9 @@ class FakeResultWrapper extends ResultWrapper {
        /** @var array|stdClass|bool */
        protected $currentRow = null;
 
+       /**
+        * @param array $array
+        */
        function __construct( $array ) {
                $this->result = $array;
        }
@@ -341,6 +321,20 @@ class LikeMatch {
 interface DBMasterPos {
        /**
         * @return float UNIX timestamp
+        * @since 1.25
         */
        public function asOfTime();
+
+       /**
+        * @param DBMasterPos $pos
+        * @return bool Whether this position is at or higher than $pos
+        * @since 1.27
+        */
+       public function hasReached( DBMasterPos $pos );
+
+       /**
+        * @return string
+        * @since 1.27
+        */
+       public function __toString();
 }