MediaWiki  master
UnknownContentHandler.php
Go to the documentation of this file.
1 <?php
35 
48  public function __construct( $modelId, $formats = null ) {
49  parent::__construct(
50  $modelId,
51  $formats ?? [
52  'application/octet-stream',
53  'application/unknown',
54  'application/x-binary',
55  'text/unknown',
56  'unknown/unknown',
57  ]
58  );
59  }
60 
69  public function serializeContent( Content $content, $format = null ) {
71  '@phan-var UnknownContent $content';
72  return $content->getData();
73  }
74 
85  public function unserializeContent( $blob, $format = null ) {
86  return new UnknownContent( $blob, $this->getModelID() );
87  }
88 
96  public function makeEmptyContent() {
97  return $this->unserializeContent( '' );
98  }
99 
103  public function supportsDirectEditing() {
104  return false;
105  }
106 
113  return new UnsupportedSlotDiffRenderer( $context );
114  }
115 }
$context
Definition: load.php:45
getSlotDiffRendererInternal(IContextSource $context)
serializeContent(Content $content, $format=null)
Returns the content&#39;s data as-is.
Produces a warning message about not being able to render a slot diff.
getModelID()
Returns the model id that identifies the content model this ContentHandler can handle.
__construct( $modelId, $formats=null)
Constructs an UnknownContentHandler.
Content object implementation representing unknown content.
Content handler implementation for unknown content.
unserializeContent( $blob, $format=null)
Constructs an UnknownContent instance wrapping the given data.
$content
Definition: router.php:78
makeEmptyContent()
Creates an empty UnknownContent object.