Semantic MediaWiki and related extensions
|
Public Member Functions | |
__construct ( $text) | |
__sleep () | |
toJson () | |
isYaml () | |
isValid () | |
fillParserOutput (Title $title, $revId, ParserOptions $options, $generateHtml, ParserOutput &$output) | |
prepareSave (WikiPage $page, $flags, $parentRevId, User $user) | |
preSaveTransform (Title $title, User $user, ParserOptions $popts) | |
setServices (SchemaFactory $schemaFactory, SchemaContentFormatter $contentFormatter=null) | |
Static Public Member Functions | |
static | normalizeLineEndings ( $text) |
The content model supports both JSON and YAML (as a superset of JSON), allowing for its content to be represented in JSON when required while a user may choose YAML to edit/store the native content (due to improve readability or aid others with additional inline comments).
Comments (among other elements) will not be represented in JSON output when requested by the Content::toJson
method.
GNU GPL v2+
SMW\MediaWiki\Content\SchemaContent::__construct | ( | $text | ) |
SMW\MediaWiki\Content\SchemaContent::__sleep | ( | ) |
This class doesn't own the properties but needs to guard against a possible serialization attempt. (
SMW\MediaWiki\Content\SchemaContent::fillParserOutput | ( | Title | $title, |
$revId, | |||
ParserOptions | $options, | ||
$generateHtml, | |||
ParserOutput & | $output | ||
) |
SMW\MediaWiki\Content\SchemaContent::isValid | ( | ) |
SMW\MediaWiki\Content\SchemaContent::isYaml | ( | ) |
boolean |
|
static |
$text |
SMW\MediaWiki\Content\SchemaContent::prepareSave | ( | WikiPage | $page, |
$flags, | |||
$parentRevId, | |||
User | $user | ||
) |
SMW\MediaWiki\Content\SchemaContent::preSaveTransform | ( | Title | $title, |
User | $user, | ||
ParserOptions | $popts | ||
) |
SMW\MediaWiki\Content\SchemaContent::setServices | ( | SchemaFactory | $schemaFactory, |
SchemaContentFormatter | $contentFormatter = null |
||
) |
SchemaFactory | $schemaFactory | |
SchemaContentFormatter | null | $contentFormatter |
SMW\MediaWiki\Content\SchemaContent::toJson | ( | ) |
Content::getNativeData
will return the "native" text representation which in case of YAML is just the text and not a JSON string. Therefore getNativeData
preserves the original user input.
Instead, use this method to retrieve a JSON compatible string for both JSON and YAML for when the data is valid.