blob: 166e15ec9f3245764ecdaeea7df3943561ee1594 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\MessageBundleTranslation;
use TextContentHandler;
use const CONTENT_FORMAT_JSON;
/**
* @author Niklas Laxström
* @license GPL-2.0-or-later
* @since 2021.05
*/
class MessageBundleContentHandler extends TextContentHandler {
public function __construct( $modelId = MessageBundleContent::CONTENT_MODEL_ID ) {
parent::__construct( $modelId, [ CONTENT_FORMAT_JSON ] );
}
protected function getContentClass() {
return MessageBundleContent::class;
}
public function makeEmptyContent() {
$class = $this->getContentClass();
return new $class( '{}' );
}
}
|