3 * JSON Schema Content Handler
7 * @author Ori Livneh <ori@wikimedia.org>
8 * @author Kunal Mehta <legoktm@gmail.com>
14 class JSONContentHandler
extends TextContentHandler
{
17 * The class name of objects that should be created
19 * @deprecated override getContentClass instead
23 protected $contentClass = 'JSONContent';
25 public function __construct( $modelId = CONTENT_MODEL_JSON
) {
26 parent
::__construct( $modelId, array( CONTENT_FORMAT_JSON
) );
30 * Temporary back-compat until extensions
31 * are updated to override this
35 protected function getContentClass() {
36 return $this->contentClass
;
40 * Returns the english language, because JSON is english, and should be handled as such.
43 * @param Content|null $content
45 * @return Language Return of wfGetLangObj( 'en' )
47 * @see ContentHandler::getPageLanguage()
49 public function getPageLanguage( Title
$title, Content
$content = null ) {
50 return wfGetLangObj( 'en' );
54 * Returns the english language, because JSON is english, and should be handled as such.
57 * @param Content|null $content
59 * @return Language Return of wfGetLangObj( 'en' )
61 * @see ContentHandler::getPageLanguage()
63 public function getPageViewLanguage( Title
$title, Content
$content = null ) {
64 return wfGetLangObj( 'en' );