r99190 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99189‎ | r99190 | r99191 >
Date:04:16, 7 October 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
follow up to r99188
Modified paths:
  • /trunk/extensions/Contest/includes/ContestantPager.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Contest/includes/ContestantPager.php
@@ -13,16 +13,32 @@
1414 */
1515 class ContestantPager extends TablePager {
1616
 17+ /**
 18+ * Query conditions, full field names (ie inc prefix).
 19+ * @var array
 20+ */
1721 protected $conds;
1822
1923 /**
 24+ * Special page on which the pager is displayed.
2025 * @var SpecialContestPage
2126 */
2227 protected $page;
2328
 29+ /**
 30+ * Cache for challenge titles.
 31+ * challenge id => challenge title
 32+ * @var array
 33+ */
2434 protected $challengeTitles = array();
2535
26 - public function __construct( $page, $conds ) {
 36+ /**
 37+ * Constructor.
 38+ *
 39+ * @param SpecialContestPage $page
 40+ * @param array $conds
 41+ */
 42+ public function __construct( SpecialContestPage $page, array $conds ) {
2743 $this->page = $page;
2844 $this->conds = $conds;
2945 $this->mDefaultDirection = true;
@@ -35,7 +51,16 @@
3652 $this->getOutput()->addModules( 'contest.contestant.pager' );
3753 }
3854
39 - protected function queryChallengeTitles( $allConds ) {
 55+ /**
 56+ * Query all challenge names we might need,
 57+ * based on the queries conditions, and set them
 58+ * to the challengeTitles field.
 59+ *
 60+ * @since 0.1
 61+ *
 62+ * @param array $allConds
 63+ */
 64+ protected function queryChallengeTitles( array $allConds ) {
4065 $conds = array();
4166
4267 if ( array_key_exists( 'contestant_contest_id', $allConds ) ) {
@@ -51,6 +76,14 @@
5277 }
5378 }
5479
 80+ /**
 81+ * Gets the title of a challenge given it's id.
 82+ *
 83+ * @since 0.1
 84+ *
 85+ * @param integer $challengeId
 86+ * @throws MWException
 87+ */
5588 protected function getChallengeTitle( $challengeId ) {
5689 if ( array_key_exists( $challengeId, $this->challengeTitles ) ) {
5790 return $this->challengeTitles[$challengeId];

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99188work on contestant pager - added challenge name and option to filter on itjeroendedauw04:01, 7 October 2011

Status & tagging log