r111306 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111305‎ | r111306 | r111307 >
Date:15:51, 12 February 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
follow up to r111305
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPArticle.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPCA.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPCourse.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPOA.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPOrg.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPRevision.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPStudent.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPUtils.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/EducationProgram.php
@@ -73,7 +73,6 @@
7474 $wgAutoloadClasses['ApiEnlist'] = dirname( __FILE__ ) . '/api/ApiEnlist.php';
7575 $wgAutoloadClasses['ApiRefreshEducation'] = dirname( __FILE__ ) . '/api/ApiRefreshEducation.php';
7676
77 -// $wgAutoloadClasses['DBDataObject'] = dirname( __FILE__ ) . '/includes/DBDataObject.php';
7877 $wgAutoloadClasses['EPCourse'] = dirname( __FILE__ ) . '/includes/EPCourse.php';
7978 $wgAutoloadClasses['EPCoursePager'] = dirname( __FILE__ ) . '/includes/EPCoursePager.php';
8079 $wgAutoloadClasses['EPInstructor'] = dirname( __FILE__ ) . '/includes/EPInstructor.php';
@@ -150,17 +149,6 @@
151150 $wgSpecialPageGroups['CampusAmbassadorProfile'] = 'education';
152151 $wgSpecialPageGroups['OnlineAmbassadorProfile'] = 'education';
153152
154 -// DB object classes
155 -$wgDBDataObjects = array();
156 -$wgDBDataObjects['EPRevision'] = array( 'table' => 'ep_revisions', 'prefix' => 'rev_' );
157 -$wgDBDataObjects['EPOrg'] = array( 'table' => 'ep_orgs', 'prefix' => 'org_' );
158 -$wgDBDataObjects['EPCourse'] = array( 'table' => 'ep_courses', 'prefix' => 'course_' );
159 -$wgDBDataObjects['EPStudent'] = array( 'table' => 'ep_students', 'prefix' => 'student_' );
160 -$wgDBDataObjects['EPOA'] = array( 'table' => 'ep_oas', 'prefix' => 'oa_' );
161 -$wgDBDataObjects['EPCA'] = array( 'table' => 'ep_cas', 'prefix' => 'ca_' );
162 -$wgDBDataObjects['EPArticle'] = array( 'table' => 'ep_articles', 'prefix' => 'article_' );
163 -$wgDBDataObjects[] = array( 'table' => 'ep_users_per_course', 'prefix' => 'upc_' );
164 -
165153 define( 'EP_STUDENT', 0 );
166154 define( 'EP_INSTRUCTOR', 1 );
167155 define( 'EP_OA', 2 );
Index: trunk/extensions/EducationProgram/includes/EPArticle.php
@@ -13,7 +13,7 @@
1414 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1515 */
1616 class EPArticle extends DBDataObject {
17 -
 17+
1818 /**
1919 * Cached user object for this revision.
2020 *
@@ -23,6 +23,22 @@
2424 protected $user = false;
2525
2626 /**
 27+ * (non-PHPdoc)
 28+ * @see DBDataObject::getDBTable()
 29+ */
 30+ public static function getDBTable() {
 31+ return 'ep_articles';
 32+ }
 33+
 34+ /**
 35+ * (non-PHPdoc)
 36+ * @see DBDataObject::getFieldPrefix()
 37+ */
 38+ public static function getFieldPrefix() {
 39+ return 'article_';
 40+ }
 41+
 42+ /**
2743 * @see parent::getFieldTypes
2844 *
2945 * @since 0.1
Index: trunk/extensions/EducationProgram/includes/EPCA.php
@@ -14,6 +14,22 @@
1515 class EPCA extends EPRoleObject implements EPIRole {
1616
1717 /**
 18+ * (non-PHPdoc)
 19+ * @see DBDataObject::getDBTable()
 20+ */
 21+ public static function getDBTable() {
 22+ return 'ep_cas';
 23+ }
 24+
 25+ /**
 26+ * (non-PHPdoc)
 27+ * @see DBDataObject::getFieldPrefix()
 28+ */
 29+ public static function getFieldPrefix() {
 30+ return 'ca_';
 31+ }
 32+
 33+ /**
1834 * @see parent::getFieldTypes
1935 *
2036 * @since 0.1
Index: trunk/extensions/EducationProgram/includes/EPStudent.php
@@ -14,6 +14,22 @@
1515 class EPStudent extends EPRoleObject {
1616
1717 /**
 18+ * (non-PHPdoc)
 19+ * @see DBDataObject::getDBTable()
 20+ */
 21+ public static function getDBTable() {
 22+ return 'ep_students';
 23+ }
 24+
 25+ /**
 26+ * (non-PHPdoc)
 27+ * @see DBDataObject::getFieldPrefix()
 28+ */
 29+ public static function getFieldPrefix() {
 30+ return 'student_';
 31+ }
 32+
 33+ /**
1834 * @see parent::getFieldTypes
1935 *
2036 * @since 0.1
Index: trunk/extensions/EducationProgram/includes/EPOrg.php
@@ -22,6 +22,22 @@
2323 protected $courses = false;
2424
2525 /**
 26+ * (non-PHPdoc)
 27+ * @see DBDataObject::getDBTable()
 28+ */
 29+ public static function getDBTable() {
 30+ return 'ep_orgs';
 31+ }
 32+
 33+ /**
 34+ * (non-PHPdoc)
 35+ * @see DBDataObject::getFieldPrefix()
 36+ */
 37+ public static function getFieldPrefix() {
 38+ return 'org_';
 39+ }
 40+
 41+ /**
2642 * @see parent::getFieldTypes
2743 *
2844 * @since 0.1
Index: trunk/extensions/EducationProgram/includes/EPRevision.php
@@ -12,7 +12,7 @@
1313 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1414 */
1515 class EPRevision extends DBDataObject {
16 -
 16+
1717 /**
1818 * Cached user object for this revision.
1919 *
@@ -35,6 +35,22 @@
3636 }
3737
3838 /**
 39+ * (non-PHPdoc)
 40+ * @see DBDataObject::getDBTable()
 41+ */
 42+ public static function getDBTable() {
 43+ return 'ep_revisions';
 44+ }
 45+
 46+ /**
 47+ * (non-PHPdoc)
 48+ * @see DBDataObject::getFieldPrefix()
 49+ */
 50+ public static function getFieldPrefix() {
 51+ return 'rev_';
 52+ }
 53+
 54+ /**
3955 * @see parent::getFieldTypes
4056 *
4157 * @since 0.1
Index: trunk/extensions/EducationProgram/includes/EPOA.php
@@ -14,6 +14,22 @@
1515 class EPOA extends EPRoleObject implements EPIRole {
1616
1717 /**
 18+ * (non-PHPdoc)
 19+ * @see DBDataObject::getDBTable()
 20+ */
 21+ public static function getDBTable() {
 22+ return 'ep_oas';
 23+ }
 24+
 25+ /**
 26+ * (non-PHPdoc)
 27+ * @see DBDataObject::getFieldPrefix()
 28+ */
 29+ public static function getFieldPrefix() {
 30+ return 'oa_';
 31+ }
 32+
 33+ /**
1834 * @see parent::getFieldTypes
1935 *
2036 * @since 0.1
Index: trunk/extensions/EducationProgram/includes/EPCourse.php
@@ -89,6 +89,22 @@
9090 }
9191
9292 /**
 93+ * (non-PHPdoc)
 94+ * @see DBDataObject::getDBTable()
 95+ */
 96+ public static function getDBTable() {
 97+ return 'ep_courses';
 98+ }
 99+
 100+ /**
 101+ * (non-PHPdoc)
 102+ * @see DBDataObject::getFieldPrefix()
 103+ */
 104+ public static function getFieldPrefix() {
 105+ return 'course_';
 106+ }
 107+
 108+ /**
93109 * @see parent::getFieldTypes
94110 *
95111 * @since 0.1
Index: trunk/extensions/EducationProgram/includes/EPUtils.php
@@ -228,14 +228,17 @@
229229 $conditions[] = array( array( 'ep_users_per_course', 'role' ), $role );
230230 }
231231
232 - return EPCourse::select(
233 - $fields,
234 - $conditions,
235 - array(),
236 - array(
237 - 'ep_users_per_course' => array( 'INNER JOIN', array( array( array( 'ep_users_per_course', 'course_id' ), array( 'ep_courses', 'id' ) ) ) ),
238 - )
239 - );
 232+ // FIXME
 233+ return array();
 234+
 235+// return EPCourse::select(
 236+// $fields,
 237+// $conditions,
 238+// array(),
 239+// array(
 240+// 'ep_users_per_course' => array( 'INNER JOIN', array( array( array( 'ep_users_per_course', 'course_id' ), array( 'ep_courses', 'id' ) ) ) ),
 241+// )
 242+// );
240243 }
241244
242245 public static function getRoleId( $roleName ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r111319Follow up to r111306;jeroendedauw19:22, 12 February 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111305follow up to r111264 - get rid of wgDBDataObjects as per suggestion by Platon...jeroendedauw15:51, 12 February 2012

Status & tagging log