Index: trunk/extensions/CodeReview/CodeRepository.php |
— | — | @@ -23,7 +23,27 @@ |
24 | 24 | return null; |
25 | 25 | } |
26 | 26 | } |
| 27 | + |
| 28 | + public static function newFromId( $id ) { |
| 29 | + $dbw = wfGetDB( DB_MASTER ); |
| 30 | + $row = $dbw->selectRow( |
| 31 | + 'code_repo', |
| 32 | + array( |
| 33 | + 'repo_id', |
| 34 | + 'repo_name', |
| 35 | + 'repo_path', |
| 36 | + 'repo_viewvc', |
| 37 | + 'repo_bugzilla' ), |
| 38 | + array( 'repo_id' => intval($id) ), |
| 39 | + __METHOD__ ); |
27 | 40 | |
| 41 | + if( $row ) { |
| 42 | + return self::newFromRow( $row ); |
| 43 | + } else { |
| 44 | + return null; |
| 45 | + } |
| 46 | + } |
| 47 | + |
28 | 48 | static function newFromRow( $row ) { |
29 | 49 | $repo = new CodeRepository(); |
30 | 50 | $repo->mId = intval($row->repo_id); |