Merge "Cleanup InfoAction"
[lhc/web/wiklou.git] / includes / db / IORMTable.php
index 853e8cd..99413f9 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 /**
  * Interface for objects representing a single database table.
+ * Documentation inline and at https://www.mediawiki.org/wiki/Manual:ORMTable
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -62,6 +63,9 @@ interface IORMTable {
         * * array
         * * blob
         *
+        * TODO: get rid of the id field. Every row instance needs to have
+        * one so this is just causing hassle at various locations by requiring an extra check for field name.
+        *
         * @since 1.20
         *
         * @return array
@@ -103,7 +107,7 @@ interface IORMTable {
         * @return ORMResult
         */
        public function select( $fields = null, array $conditions = array(),
-                                                       array $options = array(), $functionName  = null );
+                                                       array $options = array(), $functionName = null );
 
        /**
         * Selects the the specified fields of the records matching the provided
@@ -119,7 +123,7 @@ interface IORMTable {
         * @return array of self
         */
        public function selectObjects( $fields = null, array $conditions = array(),
-                                                                  array $options = array(), $functionName  = null );
+                                                                  array $options = array(), $functionName = null );
 
        /**
         * Do the actual select.
@@ -134,7 +138,7 @@ interface IORMTable {
         * @return ResultWrapper
         */
        public function rawSelect( $fields = null, array $conditions = array(),
-                                                          array $options = array(), $functionName  = null );
+                                                          array $options = array(), $functionName = null );
 
        /**
         * Selects the the specified fields of the records matching the provided
@@ -159,7 +163,7 @@ interface IORMTable {
         * @return array of array
         */
        public function selectFields( $fields = null, array $conditions = array(),
-                                                                 array $options = array(), $collapse = true, $functionName  = null );
+                                                                 array $options = array(), $collapse = true, $functionName = null );
 
        /**
         * Selects the the specified fields of the first matching record.
@@ -407,7 +411,7 @@ interface IORMTable {
         *
         * @return IORMRow
         */
-       public function newFromDBResult( stdClass $result );
+       public function newRowFromDBResult( stdClass $result );
 
        /**
         * Get a new instance of the class from an array.
@@ -419,7 +423,7 @@ interface IORMTable {
         *
         * @return IORMRow
         */
-       public function newFromArray( array $data, $loadDefaults = false );
+       public function newRow( array $data, $loadDefaults = false );
 
        /**
         * Return the names of the fields.
@@ -441,4 +445,4 @@ interface IORMTable {
         */
        public function canHaveField( $name );
 
-}
\ No newline at end of file
+}