$modelId = $title->getContentModel();
}
- $handler = ContentHandler::getForModelID( $modelId );
+ $handler = self::getForModelID( $modelId );
return $handler->unserializeContent( $text, $format );
}
public static function getForTitle( Title $title ) {
$modelId = $title->getContentModel();
- return ContentHandler::getForModelID( $modelId );
+ return self::getForModelID( $modelId );
}
/**
public static function getForContent( Content $content ) {
$modelId = $content->getModel();
- return ContentHandler::getForModelID( $modelId );
+ return self::getForModelID( $modelId );
}
/**
public static function getForModelID( $modelId ) {
global $wgContentHandlers;
- if ( isset( ContentHandler::$handlers[$modelId] ) ) {
- return ContentHandler::$handlers[$modelId];
+ if ( isset( self::$handlers[$modelId] ) ) {
+ return self::$handlers[$modelId];
}
if ( empty( $wgContentHandlers[$modelId] ) ) {
wfDebugLog( 'ContentHandler', 'Created handler for ' . $modelId
. ': ' . get_class( $handler ) );
- ContentHandler::$handlers[$modelId] = $handler;
+ self::$handlers[$modelId] = $handler;
- return ContentHandler::$handlers[$modelId];
+ return self::$handlers[$modelId];
}
/**
$formats = [];
foreach ( $wgContentHandlers as $model => $class ) {
- $handler = ContentHandler::getForModelID( $model );
+ $handler = self::getForModelID( $model );
$formats = array_merge( $formats, $handler->getSupportedFormats() );
}
/**
* Add new field definition to array.
- * @param SearchIndexField[] $fields
- * @param SearchEngine $engine
- * @param string $name
- * @param int $type
+ * @param SearchIndexField[] &$fields
+ * @param SearchEngine $engine
+ * @param string $name
+ * @param int $type
* @return SearchIndexField[] new field defs
* @since 1.28
*/
* as representation of this document.
* Overriding class should call parent function or take care of calling
* the SearchDataForIndex hook.
- * @param WikiPage $page Page to index
+ * @param WikiPage $page Page to index
* @param ParserOutput $output
* @param SearchEngine $engine Search engine for which we are indexing
* @return array Map of name=>value for fields
*
* Specific content handlers may override it if they need different content handling.
*
- * @param WikiPage $page
+ * @param WikiPage $page
* @param ParserCache $cache
* @return ParserOutput
*/