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

Static Public Member Functions

static createPersistentContent ( $input)
 Validates and creates a ZPersistentObject from the given input data.
 
static validatePersistentKeys ( $input)
 Check that the required ZPersistentObject keys exists and, if they don't, raise Z511/Missing key errors.
 
static create ( $input)
 Validates and creates an object of type ZObject from a given input data.
 
static createCustom ( $input)
 Creates an instance of a custom or user-defined type after validating its basic structure: the keys are valid ZObject keys and the values have the correct types.
 
static createChild ( $object)
 Creates an object of type ZObject from the given input.
 

Member Function Documentation

◆ create()

static MediaWiki\Extension\WikiLambda\ZObjectFactory::create ( $input)
static

Validates and creates an object of type ZObject from a given input data.

The resulting ZObject will be structurally valid or well-formed.

This method is the entrypoint from WikiLambda ZObject creation parting from their serialized representation.

Parameters
string | array | \stdClass$input
Returns
ZObject
Exceptions
ZErrorException
+ Here is the caller graph for this function:

◆ createChild()

static MediaWiki\Extension\WikiLambda\ZObjectFactory::createChild ( $object)
static

Creates an object of type ZObject from the given input.

This method should only be called internally, either from the ZObjectFactory of from the ZObject constructors. ZObjects created using this method will not necessarily be structurally valid.

Parameters
string | array | ZObject | \stdClass$objectThe item to turn into a ZObject
Returns
ZObject
Exceptions
ZErrorException
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createCustom()

static MediaWiki\Extension\WikiLambda\ZObjectFactory::createCustom ( $input)
static

Creates an instance of a custom or user-defined type after validating its basic structure: the keys are valid ZObject keys and the values have the correct types.

Deprecated
Parameters
string | array | \stdClass$input
Returns
ZObject
Exceptions
ZErrorException

◆ createPersistentContent()

static MediaWiki\Extension\WikiLambda\ZObjectFactory::createPersistentContent ( $input)
static

Validates and creates a ZPersistentObject from the given input data.

If the input already has the ZPersistentObejct keys, it uses them to construct the wrapper object. If not, it builds a wrapper ZPersistentObject with empty values. The resulting ZObject will be structurally valid or well-formed.

This method is the entrypoint from WikiLambda content object.

Parameters
string | array | \stdClass$inputThe item to turn into a ZObject
Returns
ZPersistentObject
Exceptions
ZErrorException
+ Here is the call graph for this function:

◆ validatePersistentKeys()

static MediaWiki\Extension\WikiLambda\ZObjectFactory::validatePersistentKeys ( $input)
static

Check that the required ZPersistentObject keys exists and, if they don't, raise Z511/Missing key errors.

Parameters
string | array | \stdClass$inputThe item to check is a ZObject
Returns
bool
Exceptions
ZErrorException
+ Here is the caller graph for this function:

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