Thiemo Mättig (WMDE) has uploaded a new change for review.
https://gerrit.wikimedia.org/r/165454
Change subject: Drop ORMTable::getFieldPrefix
......................................................................
Drop ORMTable::getFieldPrefix
This patch is a no-op. It doesn't change anything but is a
prerequisit for I46a0d7e.
Change-Id: Ib7be38f5c830ba7c9e46d325a28cb16711fc3fbb
---
M includes/Extension.php
M includes/tables/CAs.php
M includes/tables/Courses.php
M includes/tables/Events.php
M includes/tables/Instructors.php
M includes/tables/OAs.php
M includes/tables/Orgs.php
M includes/tables/PageTable.php
M includes/tables/Revisions.php
M includes/tables/Students.php
10 files changed, 38 insertions(+), 75 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EducationProgram
refs/changes/54/165454/1
diff --git a/includes/Extension.php b/includes/Extension.php
index 8c07b39..fd3bbc6 100644
--- a/includes/Extension.php
+++ b/includes/Extension.php
@@ -4,7 +4,6 @@
use EducationProgram\Events\EventStore;
use EducationProgram\Store\CourseStore;
-use ORMTable;
/**
* Main extension class, acts as dependency injection container look-alike.
diff --git a/includes/tables/CAs.php b/includes/tables/CAs.php
index c7ff1a5..9ea3292 100644
--- a/includes/tables/CAs.php
+++ b/includes/tables/CAs.php
@@ -14,6 +14,10 @@
*/
class CAs extends \ORMTable {
+ public function __construct() {
+ $this->fieldPrefix = 'ca_';
+ }
+
/**
* @see ORMTable::getName()
* @since 0.1
@@ -21,15 +25,6 @@
*/
public function getName() {
return 'ep_cas';
- }
-
- /**
- * @see ORMTable::getFieldPrefix()
- * @since 0.1
- * @return string
- */
- public function getFieldPrefix() {
- return 'ca_';
}
/**
diff --git a/includes/tables/Courses.php b/includes/tables/Courses.php
index 1e2897c..3a3cdcd 100644
--- a/includes/tables/Courses.php
+++ b/includes/tables/Courses.php
@@ -1,7 +1,9 @@
<?php
namespace EducationProgram;
-use ORMResult, Title;
+
+use ORMResult;
+use Title;
/**
* Class representing the ep_courses table.
@@ -20,6 +22,10 @@
// a new course.
const DEFAULT_COURSE_DURATION = '+6 months';
+ public function __construct() {
+ $this->fieldPrefix = 'course_';
+ }
+
/**
* @see ORMTable::getName()
* @since 0.1
@@ -27,15 +33,6 @@
*/
public function getName() {
return 'ep_courses';
- }
-
- /**
- * @see ORMTable::getFieldPrefix()
- * @since 0.1
- * @return string
- */
- public function getFieldPrefix() {
- return 'course_';
}
/**
diff --git a/includes/tables/Events.php b/includes/tables/Events.php
index 6753399..e770cef 100644
--- a/includes/tables/Events.php
+++ b/includes/tables/Events.php
@@ -14,6 +14,10 @@
*/
class Events extends \ORMTable {
+ public function __construct() {
+ $this->fieldPrefix = 'event_';
+ }
+
/**
* @see ORMTable::getName()
* @since 0.1
@@ -21,15 +25,6 @@
*/
public function getName() {
return 'ep_events';
- }
-
- /**
- * @see ORMTable::getFieldPrefix()
- * @since 0.1
- * @return string
- */
- public function getFieldPrefix() {
- return 'event_';
}
/**
diff --git a/includes/tables/Instructors.php b/includes/tables/Instructors.php
index e86a0a7..2d5e18e 100644
--- a/includes/tables/Instructors.php
+++ b/includes/tables/Instructors.php
@@ -14,6 +14,10 @@
*/
class Instructors extends \ORMTable {
+ public function __construct() {
+ $this->fieldPrefix = 'instructor_';
+ }
+
/**
* @see ORMTable::getName()
* @since 0.1
@@ -21,15 +25,6 @@
*/
public function getName() {
return 'ep_instructors';
- }
-
- /**
- * @see ORMTable::getFieldPrefix()
- * @since 0.1
- * @return string
- */
- public function getFieldPrefix() {
- return 'instructor_';
}
/**
diff --git a/includes/tables/OAs.php b/includes/tables/OAs.php
index e5de189..88796f6 100644
--- a/includes/tables/OAs.php
+++ b/includes/tables/OAs.php
@@ -14,6 +14,10 @@
*/
class OAs extends \ORMTable {
+ public function __construct() {
+ $this->fieldPrefix = 'oa_';
+ }
+
/**
* @see ORMTable::getName()
* @since 0.1
@@ -21,15 +25,6 @@
*/
public function getName() {
return 'ep_oas';
- }
-
- /**
- * @see ORMTable::getFieldPrefix()
- * @since 0.1
- * @return string
- */
- public function getFieldPrefix() {
- return 'oa_';
}
/**
diff --git a/includes/tables/Orgs.php b/includes/tables/Orgs.php
index 2728189..b1985e0 100644
--- a/includes/tables/Orgs.php
+++ b/includes/tables/Orgs.php
@@ -21,6 +21,10 @@
*/
protected $read_master_for_summaries = false;
+ public function __construct() {
+ $this->fieldPrefix = 'org_';
+ }
+
/**
* @see ORMTable::getName()
* @since 0.1
@@ -28,15 +32,6 @@
*/
public function getName() {
return 'ep_orgs';
- }
-
- /**
- * @see ORMTable::getFieldPrefix()
- * @since 0.1
- * @return string
- */
- public function getFieldPrefix() {
- return 'org_';
}
/**
diff --git a/includes/tables/PageTable.php b/includes/tables/PageTable.php
index 50d8bd9..8ef917a 100644
--- a/includes/tables/PageTable.php
+++ b/includes/tables/PageTable.php
@@ -1,7 +1,9 @@
<?php
namespace EducationProgram;
-use Linker, Title;
+
+use Linker;
+use Title;
/**
* Abstract base class ORMRows that have associated page views.
diff --git a/includes/tables/Revisions.php b/includes/tables/Revisions.php
index cccbef5..5f647f5 100644
--- a/includes/tables/Revisions.php
+++ b/includes/tables/Revisions.php
@@ -14,6 +14,10 @@
*/
class Revisions extends \ORMTable {
+ public function __construct() {
+ $this->fieldPrefix = 'rev_';
+ }
+
/**
* @see ORMTable::getName()
* @since 0.1
@@ -21,15 +25,6 @@
*/
public function getName() {
return 'ep_revisions';
- }
-
- /**
- * @see ORMTable::getFieldPrefix()
- * @since 0.1
- * @return string
- */
- public function getFieldPrefix() {
- return 'rev_';
}
/**
diff --git a/includes/tables/Students.php b/includes/tables/Students.php
index 64aa369..91b3819 100644
--- a/includes/tables/Students.php
+++ b/includes/tables/Students.php
@@ -14,6 +14,10 @@
*/
class Students extends \ORMTable {
+ public function __construct() {
+ $this->fieldPrefix = 'student_';
+ }
+
/**
* @see ORMTable::getName()
* @since 0.1
@@ -21,15 +25,6 @@
*/
public function getName() {
return 'ep_students';
- }
-
- /**
- * @see ORMTable::getFieldPrefix()
- * @since 0.1
- * @return string
- */
- public function getFieldPrefix() {
- return 'student_';
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/165454
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib7be38f5c830ba7c9e46d325a28cb16711fc3fbb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EducationProgram
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits