- /**
- * Parse the Content object and generate a ParserOutput from the result.
- * $result->getText() can be used to obtain the generated HTML. If no HTML
- * is needed, $generateHtml can be set to false; in that case,
- * $result->getText() may return null.
- *
- * @param $content Content the content to render
- * @param $title Title The page title to use as a context for rendering
- * @param $revId null|int The revision being rendered (optional)
- * @param $options null|ParserOptions Any parser options
- * @param $generateHtml Boolean Whether to generate HTML (default: true). If false,
- * the result of calling getText() on the ParserOutput object returned by
- * this method is undefined.
- *
- * @since WD.1
- *
- * @return ParserOutput
- */
- public abstract function getParserOutput( Content $content, Title $title,
- $revId = null,
- ParserOptions $options = null, $generateHtml = true );
- # TODO: make RenderOutput and RenderOptions base classes
-
- /**
- * Returns a list of DataUpdate objects for recording information about this
- * Content in some secondary data store. If the optional second argument,
- * $old, is given, the updates may model only the changes that need to be
- * made to replace information about the old content with information about
- * the new content.
- *
- * This default implementation calls
- * $this->getParserOutput( $content, $title, null, null, false ),
- * and then calls getSecondaryDataUpdates( $title, $recursive ) on the
- * resulting ParserOutput object.
- *
- * Subclasses may implement this to determine the necessary updates more
- * efficiently, or make use of information about the old content.
- *
- * @param $content Content The content for determining the necessary updates
- * @param $title Title The context for determining the necessary updates
- * @param $old Content|null An optional Content object representing the
- * previous content, i.e. the content being replaced by this Content
- * object.
- * @param $recursive boolean Whether to include recursive updates (default:
- * false).
- * @param $parserOutput ParserOutput|null Optional ParserOutput object.
- * Provide if you have one handy, to avoid re-parsing of the content.
- *
- * @return Array. A list of DataUpdate objects for putting information
- * about this content object somewhere.
- *
- * @since WD.1
- */
- public function getSecondaryDataUpdates( Content $content, Title $title,
- Content $old = null,
- $recursive = true, ParserOutput $parserOutput = null
- ) {
- if ( !$parserOutput ) {
- $parserOutput = $this->getParserOutput( $content, $title, null, null, false );
- }
-
- return $parserOutput->getSecondaryDataUpdates( $title, $recursive );
- }
-
-