From 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 12 Aug 2013 09:28:15 +0200 Subject: Update to MediaWiki 1.21.1 --- includes/db/IORMTable.php | 91 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 80 insertions(+), 11 deletions(-) (limited to 'includes/db/IORMTable.php') diff --git a/includes/db/IORMTable.php b/includes/db/IORMTable.php index 99413f99..36865655 100644 --- a/includes/db/IORMTable.php +++ b/includes/db/IORMTable.php @@ -23,7 +23,7 @@ * @file * @ingroup ORM * - * @licence GNU GPL v2 or later + * @license GNU GPL v2 or later * @author Jeroen De Dauw < jeroendedauw@gmail.com > */ @@ -97,6 +97,8 @@ interface IORMTable { * Selects the the specified fields of the records matching the provided * conditions and returns them as DBDataObject. Field names get prefixed. * + * @see DatabaseBase::select() + * * @since 1.20 * * @param array|string|null $fields @@ -104,7 +106,8 @@ interface IORMTable { * @param array $options * @param string|null $functionName * - * @return ORMResult + * @return ORMResult The result set + * @throws DBQueryError if the query failed (even if the database was in ignoreErrors mode) */ public function select( $fields = null, array $conditions = array(), array $options = array(), $functionName = null ); @@ -136,6 +139,7 @@ interface IORMTable { * @param null|string $functionName * * @return ResultWrapper + * @throws DBQueryError if the query failed (even if the database was in ignoreErrors mode) */ public function rawSelect( $fields = null, array $conditions = array(), array $options = array(), $functionName = null ); @@ -229,6 +233,15 @@ interface IORMTable { */ public function has( array $conditions = array() ); + /** + * Checks if the table exists + * + * @since 1.21 + * + * @return boolean + */ + public function exists(); + /** * Returns the amount of matching records. * Condition field names get prefixed. @@ -298,6 +311,71 @@ interface IORMTable { */ public function setReadDb( $db ); + /** + * Get the ID of the any foreign wiki to use as a target for database operations + * + * @since 1.20 + * + * @return String|bool The target wiki, in a form that LBFactory understands (or false if the local wiki is used) + */ + public function getTargetWiki(); + + /** + * Set the ID of the any foreign wiki to use as a target for database operations + * + * @param string|bool $wiki The target wiki, in a form that LBFactory understands (or false if the local wiki shall be used) + * + * @since 1.20 + */ + public function setTargetWiki( $wiki ); + + /** + * Get the database type used for read operations. + * This is to be used instead of wfGetDB. + * + * @see LoadBalancer::getConnection + * + * @since 1.20 + * + * @return DatabaseBase The database object + */ + public function getReadDbConnection(); + + /** + * Get the database type used for read operations. + * This is to be used instead of wfGetDB. + * + * @see LoadBalancer::getConnection + * + * @since 1.20 + * + * @return DatabaseBase The database object + */ + public function getWriteDbConnection(); + + /** + * Get the database type used for read operations. + * + * @see wfGetLB + * + * @since 1.20 + * + * @return LoadBalancer The database load balancer object + */ + public function getLoadBalancer(); + + /** + * Releases the lease on the given database connection. This is useful mainly + * for connections to a foreign wiki. It does nothing for connections to the local wiki. + * + * @see LoadBalancer::reuseConnection + * + * @param DatabaseBase $db the database + * + * @since 1.20 + */ + public function releaseConnection( DatabaseBase $db ); + /** * Update the records matching the provided conditions by * setting the fields that are keys in the $values param to @@ -380,15 +458,6 @@ interface IORMTable { */ public function unprefixFieldName( $fieldName ); - /** - * Get an instance of this class. - * - * @since 1.20 - * - * @return IORMTable - */ - public static function singleton(); - /** * Get an array with fields from a database result, * that can be fed directly to the constructor or -- cgit v1.2.3-54-g00ecf