WikiLambda
MediaWiki WikiLambda extension
Loading...
Searching...
No Matches
MediaWiki\Extension\WikiLambda\ZObjectContent Class Reference

This class represents the wrapper for a ZObject, as stored in MediaWiki. More...

+ Inheritance diagram for MediaWiki\Extension\WikiLambda\ZObjectContent:
+ Collaboration diagram for MediaWiki\Extension\WikiLambda\ZObjectContent:

Public Member Functions

 __construct ( $text)
 Builds the Content object that can be saved in the Wiki Doesn't validate the ZObject, but checks for syntactical validity.
 
 validateFields ( $context)
 Validate fields and throws a ZErrorException if any of the following validations don't pass successfully:
 
 isValid ()
 @inheritDoc
 
 getStatus ()
 
 getErrors ()
 
 getText ()
 @inheritDoc
 
 getObject ()
 
 getZObject ()
 
 getInnerZObject ()
 Wrapper for ZPersistentObject getInnerZObject method.
 
 getZid ()
 Wrapper for ZPersistentObject getZid method.
 
 getTypeString ( $language)
 String representation of the type of this ZObject.
 
 getTypeStringAndLanguage ( $language)
 Two string representations (and the language code of that representation) of this ZObject.
 
 getZType ()
 Wrapper for ZPersistentObject getInternalZType method.
 
 getZValue ()
 Wrapper for ZPersistentObject getZValue method.
 
 getLabels ()
 Wrapper for ZPersistentObject getLabels method.
 
 getLabel ( $language)
 Wrapper for ZPersistentObject getLabel method.
 
 getAliases ()
 Wrapper for ZPersistentObject getAliases method.
 
 getTextForSearchIndex ()
 @inheritDoc
 
 getWikitextForTransclusion ()
 @inheritDoc
 
 getTextForSummary ( $maxLength=250)
 @inheritDoc
 
 getNativeData ()
 @inheritDoc
 
 getSize ()
 @inheritDoc
 
 copy ()
 @inheritDoc
 
 convert ( $toModel, $lossy='')
 @inheritDoc
 
 isCountable ( $hasLinks=null)
 @inheritDoc
 

Detailed Description

This class represents the wrapper for a ZObject, as stored in MediaWiki.

Though its form is intentionally similar to that of a ZObject, representing a Z2/Persistent ZObject, it has several differences to account for the Content hierarchy and how it serves as the bridge between MediaWiki 'real' content and the functional model.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\WikiLambda\ZObjectContent::__construct ( $text)

Builds the Content object that can be saved in the Wiki Doesn't validate the ZObject, but checks for syntactical validity.

Parameters
string$text
Exceptions
ZErrorException
+ Here is the call graph for this function:

Member Function Documentation

◆ getAliases()

MediaWiki\Extension\WikiLambda\ZObjectContent::getAliases ( )

Wrapper for ZPersistentObject getAliases method.

Returns the aliases of the ZPersistentObject.

Returns
ZMultiLingualStringSet
Exceptions
ZErrorException

◆ getErrors()

MediaWiki\Extension\WikiLambda\ZObjectContent::getErrors ( )
Returns
ZError

◆ getInnerZObject()

MediaWiki\Extension\WikiLambda\ZObjectContent::getInnerZObject ( )

Wrapper for ZPersistentObject getInnerZObject method.

Returns the inner ZObject.

Returns
ZObject
Exceptions
ZErrorException

◆ getLabel()

MediaWiki\Extension\WikiLambda\ZObjectContent::getLabel ( $language)

Wrapper for ZPersistentObject getLabel method.

Returns the label for a given Language (or its fallback).

Parameters
Language$languageLanguage in which to provide the label.
Returns
?string
Exceptions
ZErrorException

◆ getLabels()

MediaWiki\Extension\WikiLambda\ZObjectContent::getLabels ( )

Wrapper for ZPersistentObject getLabels method.

Returns the labels of the ZPersistentObject.

Returns
ZMultilingualString
Exceptions
ZErrorException
+ Here is the caller graph for this function:

◆ getObject()

MediaWiki\Extension\WikiLambda\ZObjectContent::getObject ( )
Returns
\stdClass

◆ getStatus()

MediaWiki\Extension\WikiLambda\ZObjectContent::getStatus ( )
Returns
Status|null

◆ getTypeString()

MediaWiki\Extension\WikiLambda\ZObjectContent::getTypeString ( $language)

String representation of the type of this ZObject.

Parameters
Language$languageLanguage in which to provide the string.
Returns
string
Exceptions
ZErrorException

◆ getTypeStringAndLanguage()

MediaWiki\Extension\WikiLambda\ZObjectContent::getTypeStringAndLanguage ( $language)

Two string representations (and the language code of that representation) of this ZObject.

Parameters
Language$languageLanguage in which to provide the string.
Returns
array An array containing the following keys (all in string form): title => the label of the type type => which is the label of the type and the zCode of the type languageCode
Exceptions
ZErrorException

◆ getZid()

MediaWiki\Extension\WikiLambda\ZObjectContent::getZid ( )

Wrapper for ZPersistentObject getZid method.

Returns the Zid of the persistent object

Returns
string The persisted (or null) Zid
Exceptions
ZErrorException

◆ getZObject()

MediaWiki\Extension\WikiLambda\ZObjectContent::getZObject ( )
Returns
ZPersistentObject|null

◆ getZType()

MediaWiki\Extension\WikiLambda\ZObjectContent::getZType ( )

Wrapper for ZPersistentObject getInternalZType method.

Returns the ZType of the internal ZObject.

Returns
string
Exceptions
ZErrorException

◆ getZValue()

MediaWiki\Extension\WikiLambda\ZObjectContent::getZValue ( )

Wrapper for ZPersistentObject getZValue method.

Returns the value of the internal ZObject.

Returns
mixed
Exceptions
ZErrorException

◆ validateFields()

MediaWiki\Extension\WikiLambda\ZObjectContent::validateFields ( $context)

Validate fields and throws a ZErrorException if any of the following validations don't pass successfully:

  • ZPersistentObject description: validate the length of the description field
  • ZPersistentObject name: validate the length of the name field
Parameters
MessageLocalizer$contextThe context of the action operation, for localisation of messages
Exceptions
ZErrorException
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: