From: Yuri Astrakhan Date: Mon, 2 Oct 2006 16:17:57 +0000 (+0000) Subject: New method loadFromId() per brion's suggestion. Reverted newFromId() change. X-Git-Tag: 1.31.0-rc.0~55668 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=09c423f42e90ffbf01a5d37df157e46b0c57dd4e;p=lhc%2Fweb%2Fwiklou.git New method loadFromId() per brion's suggestion. Reverted newFromId() change. --- diff --git a/includes/Revision.php b/includes/Revision.php index 3c99d46af1..8ea4df2a87 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -22,16 +22,13 @@ class Revision { * Returns null if no such revision can be found. * * @param int $id - * @param Database $db * @access public * @static */ - public static function newFromId( $id, $db = null ) { - $conditions = array( 'page_id=rev_page', 'rev_id' => intval( $id )); - if (is_null($db)) - return Revision::newFromConds( $conditions ); - else - return Revision::loadFromConds( $db, $conditions ); + public static function newFromId( $id ) { + return Revision::newFromConds( + array( 'page_id=rev_page', + 'rev_id' => intval( $id ) ) ); } /** @@ -58,6 +55,21 @@ class Revision { 'page_title' => $title->getDbkey() ) ); } + /** + * Load a page revision from a given revision ID number. + * Returns null if no such revision can be found. + * + * @param Database $db + * @param int $id + * @access public + * @static + */ + public static function loadFromId( &$db, $id ) { + return Revision::loadFromConds( $db, + array( 'page_id=rev_page', + 'rev_id' => intval( $id ) ) ); + } + /** * Load either the current, or a specified, revision * that's attached to a given page. If not attached