* Gets the db field prefix.
*
* @since 1.20
+ * @deprecated since 1.25, use the $this->fieldPrefix property instead
*
* @return string
*/
* @return string
*/
public function getPrefixedField( $field ) {
- return $this->getFieldPrefix() . $field;
+ return $this->fieldPrefix . $field;
}
/**
* @return string
*/
public function unprefixFieldName( $fieldName ) {
- return substr( $fieldName, strlen( $this->getFieldPrefix() ) );
+ return substr( $fieldName, strlen( $this->fieldPrefix ) );
}
/**
class PageORMTableForTesting extends ORMTable {
+ public function __construct() {
+ $this->fieldPrefix = 'page_';
+ }
+
/**
* @see ORMTable::getName
*
'title' => 'str',
);
}
-
- /**
- * @see ORMTable::getFieldPrefix
- *
- * @return string
- */
- protected function getFieldPrefix() {
- return 'page_';
- }
}
class TestORMTable extends ORMTable {
+ public function __construct() {
+ $this->fieldPrefix = 'test_';
+ }
+
/**
* Returns the name of the database table objects of this type are stored in.
*
'time' => 'str', // TS_MW
);
}
-
- /**
- * Gets the db field prefix.
- *
- * @since 1.20
- *
- * @return string
- */
- protected function getFieldPrefix() {
- return 'test_';
- }
}