Index: trunk/extensions/EducationProgram/EducationProgram.php |
— | — | @@ -73,7 +73,6 @@ |
74 | 74 | $wgAutoloadClasses['ApiEnlist'] = dirname( __FILE__ ) . '/api/ApiEnlist.php'; |
75 | 75 | $wgAutoloadClasses['ApiRefreshEducation'] = dirname( __FILE__ ) . '/api/ApiRefreshEducation.php'; |
76 | 76 | |
77 | | -// $wgAutoloadClasses['DBDataObject'] = dirname( __FILE__ ) . '/includes/DBDataObject.php'; |
78 | 77 | $wgAutoloadClasses['EPCourse'] = dirname( __FILE__ ) . '/includes/EPCourse.php'; |
79 | 78 | $wgAutoloadClasses['EPCoursePager'] = dirname( __FILE__ ) . '/includes/EPCoursePager.php'; |
80 | 79 | $wgAutoloadClasses['EPInstructor'] = dirname( __FILE__ ) . '/includes/EPInstructor.php'; |
— | — | @@ -150,17 +149,6 @@ |
151 | 150 | $wgSpecialPageGroups['CampusAmbassadorProfile'] = 'education'; |
152 | 151 | $wgSpecialPageGroups['OnlineAmbassadorProfile'] = 'education'; |
153 | 152 | |
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 | | - |
165 | 153 | define( 'EP_STUDENT', 0 ); |
166 | 154 | define( 'EP_INSTRUCTOR', 1 ); |
167 | 155 | define( 'EP_OA', 2 ); |
Index: trunk/extensions/EducationProgram/includes/EPArticle.php |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
15 | 15 | */ |
16 | 16 | class EPArticle extends DBDataObject { |
17 | | - |
| 17 | + |
18 | 18 | /** |
19 | 19 | * Cached user object for this revision. |
20 | 20 | * |
— | — | @@ -23,6 +23,22 @@ |
24 | 24 | protected $user = false; |
25 | 25 | |
26 | 26 | /** |
| 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 | + /** |
27 | 43 | * @see parent::getFieldTypes |
28 | 44 | * |
29 | 45 | * @since 0.1 |
Index: trunk/extensions/EducationProgram/includes/EPCA.php |
— | — | @@ -14,6 +14,22 @@ |
15 | 15 | class EPCA extends EPRoleObject implements EPIRole { |
16 | 16 | |
17 | 17 | /** |
| 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 | + /** |
18 | 34 | * @see parent::getFieldTypes |
19 | 35 | * |
20 | 36 | * @since 0.1 |
Index: trunk/extensions/EducationProgram/includes/EPStudent.php |
— | — | @@ -14,6 +14,22 @@ |
15 | 15 | class EPStudent extends EPRoleObject { |
16 | 16 | |
17 | 17 | /** |
| 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 | + /** |
18 | 34 | * @see parent::getFieldTypes |
19 | 35 | * |
20 | 36 | * @since 0.1 |
Index: trunk/extensions/EducationProgram/includes/EPOrg.php |
— | — | @@ -22,6 +22,22 @@ |
23 | 23 | protected $courses = false; |
24 | 24 | |
25 | 25 | /** |
| 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 | + /** |
26 | 42 | * @see parent::getFieldTypes |
27 | 43 | * |
28 | 44 | * @since 0.1 |
Index: trunk/extensions/EducationProgram/includes/EPRevision.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
14 | 14 | */ |
15 | 15 | class EPRevision extends DBDataObject { |
16 | | - |
| 16 | + |
17 | 17 | /** |
18 | 18 | * Cached user object for this revision. |
19 | 19 | * |
— | — | @@ -35,6 +35,22 @@ |
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
| 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 | + /** |
39 | 55 | * @see parent::getFieldTypes |
40 | 56 | * |
41 | 57 | * @since 0.1 |
Index: trunk/extensions/EducationProgram/includes/EPOA.php |
— | — | @@ -14,6 +14,22 @@ |
15 | 15 | class EPOA extends EPRoleObject implements EPIRole { |
16 | 16 | |
17 | 17 | /** |
| 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 | + /** |
18 | 34 | * @see parent::getFieldTypes |
19 | 35 | * |
20 | 36 | * @since 0.1 |
Index: trunk/extensions/EducationProgram/includes/EPCourse.php |
— | — | @@ -89,6 +89,22 @@ |
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
| 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 | + /** |
93 | 109 | * @see parent::getFieldTypes |
94 | 110 | * |
95 | 111 | * @since 0.1 |
Index: trunk/extensions/EducationProgram/includes/EPUtils.php |
— | — | @@ -228,14 +228,17 @@ |
229 | 229 | $conditions[] = array( array( 'ep_users_per_course', 'role' ), $role ); |
230 | 230 | } |
231 | 231 | |
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 | +// ); |
240 | 243 | } |
241 | 244 | |
242 | 245 | public static function getRoleId( $roleName ) { |