*
* @since WD.1
*
- * @return int The model id
+ * @return String The model id
*/
public function getModel();
*
* @since WD.1
*
- * @return ContentHandler
+ * @return String
*/
public function getDefaultFormat();
# FUTURE: special type for redirects?!
# FUTURE: MultipartMultipart < WikipageContent (Main + Links + X)
# FUTURE: LinksContent < LanguageLinksContent, CategoriesContent
-
- // @TODO: add support for ar_content_format, ar_content_model,
- // rev_content_format, rev_content_model to API
}
protected $model_id;
/**
- * @param $model_id int
+ * @param String $model_id
*/
public function __construct( $model_id = null ) {
$this->model_id = $model_id;
*/
protected function checkModelID( $model_id ) {
if ( $model_id !== $this->model_id ) {
- $model_name = ContentHandler::getContentModelName( $model_id );
- $own_model_name = ContentHandler::getContentModelName( $this->model_id );
-
- throw new MWException( "Bad content model: " .
- "expected {$this->model_id} ($own_model_name) " .
- "but got $model_id ($model_name)." );
+ throw new MWException( "Bad content model: " .
+ "expected {$this->model_id} " .
+ "but got $model_id." );
}
}
$sectionModelId = $with->getModel();
if ( $sectionModelId != $myModelId ) {
- $myModelName = ContentHandler::getContentModelName( $myModelId );
- $sectionModelName = ContentHandler::getContentModelName( $sectionModelId );
-
- throw new MWException( "Incompatible content model for section: " .
- "document uses $myModelId ($myModelName), " .
- "section uses $sectionModelId ($sectionModelName)." );
+ throw new MWException( "Incompatible content model for section: " .
+ "document uses $myModelId but " .
+ "section uses $sectionModelId." );
}
$oldtext = $this->getNativeData();