WikiLambda
MediaWiki WikiLambda extension
Loading...
Searching...
No Matches
MediaWiki\Extension\WikiLambda\ZObjects\ZTypedList Class Reference
+ Inheritance diagram for MediaWiki\Extension\WikiLambda\ZObjects\ZTypedList:
+ Collaboration diagram for MediaWiki\Extension\WikiLambda\ZObjects\ZTypedList:

Public Member Functions

 __construct ( $functionCall, $head=null, $tail=null)
 Create a new ZTypedList instance given an array (canonical form) or an object with K1 (head) and K2 (tail)
 
 isValid ()
 @inheritDoc
 
 appendArray (array $newElements, bool $checkTypes=true)
 Add the new elements, given as an array of ZObjects, to the end of the list.
 
 appendZTypedList (ZTypedList $newElements, bool $checkTypes=true)
 Add the new elements, given as a ZTypedList, to the end of the list.
 
 getSerialized ( $form=self::FORM_CANONICAL)
 @inheritDoc
 
 getAsArray ()
 Get the array of ZObjects represented by this list.
 
 getElementType ()
 Returns the type of the elements of this ZTypedList.
 
 isEmpty ()
 Returns true if it contains an empty list.
 
- Public Member Functions inherited from MediaWiki\Extension\WikiLambda\ZObjects\ZObject
 __construct ( $type)
 Construct a new ZObject instance.
 
 getValueByKey (string $key)
 Fetch value of given key from the current ZObject.
 
 setValueByKey (string $key, ZObject $value)
 Set a value of given key in the current ZObject.
 
 isBuiltin ()
 Returns whether this ZObject is a builtin class.
 
 isTypeReference ()
 Returns whether the object type is a ZReference that points to a type.
 
 isTypeFunctionCall ()
 Returns whether the object type is a ZFunctionCall that resolves to a type.
 
 getZTypeObject ()
 Returns either the ZReference or the ZFunctionCall that contain the type of this ZObject (Z1K1)
 
 getZType ()
 Returns a string with the Zid representing the type of this ZObject.
 
 getZValue ()
 Return the untyped content of this ZObject.
 
 getLinkedZObjects ()
 Return all ZObject Zids that are linked to the current ZObject.
 
 getHumanReadable ( $language=null)
 Convert this ZObject into human readable object by translating all keys and references into the preferred language or its fallbacks.
 
 __toString ()
 Over-ride the default __toString() method to serialise ZObjects into a JSON representation.
 

Static Public Member Functions

static getDefinition ()
 @inheritDoc
 
static buildType ( $listType)
 Build the function call that defines the type of this ZTypedList.
 

Additional Inherited Members

- Public Attributes inherited from MediaWiki\Extension\WikiLambda\ZObjects\ZObject
const FORM_CANONICAL = 1
 
const FORM_NORMAL = 2
 
- Protected Attributes inherited from MediaWiki\Extension\WikiLambda\ZObjects\ZObject
 $type = null
 
 $data = []
 
 $linkedZObjects = []
 

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\WikiLambda\ZObjects\ZTypedList::__construct ( $functionCall,
$head = null,
$tail = null )

Create a new ZTypedList instance given an array (canonical form) or an object with K1 (head) and K2 (tail)

Parameters
ZFunctionCall$functionCall
array | ZObject | null$head
ZTypedList | null$tail

Member Function Documentation

◆ appendArray()

MediaWiki\Extension\WikiLambda\ZObjects\ZTypedList::appendArray ( array $newElements,
bool $checkTypes = true )

Add the new elements, given as an array of ZObjects, to the end of the list.

Parameters
array$newElements
bool$checkTypes

◆ appendZTypedList()

MediaWiki\Extension\WikiLambda\ZObjects\ZTypedList::appendZTypedList ( ZTypedList $newElements,
bool $checkTypes = true )

Add the new elements, given as a ZTypedList, to the end of the list.

Parameters
ZTypedList$newElements
bool$checkTypes
+ Here is the call graph for this function:

◆ buildType()

static MediaWiki\Extension\WikiLambda\ZObjects\ZTypedList::buildType ( $listType)
static

Build the function call that defines the type of this ZTypedList.

Parameters
string$listTypeThe ZID of the type of ZObjects this list contains
Returns
ZFunctionCall
+ Here is the caller graph for this function:

◆ getAsArray()

MediaWiki\Extension\WikiLambda\ZObjects\ZTypedList::getAsArray ( )

Get the array of ZObjects represented by this list.

Returns
array
+ Here is the caller graph for this function:

◆ getDefinition()

static MediaWiki\Extension\WikiLambda\ZObjects\ZTypedList::getDefinition ( )
static

@inheritDoc

Reimplemented from MediaWiki\Extension\WikiLambda\ZObjects\ZObject.

◆ getElementType()

MediaWiki\Extension\WikiLambda\ZObjects\ZTypedList::getElementType ( )

Returns the type of the elements of this ZTypedList.

Returns
ZObject The type of this ZObject

◆ getSerialized()

MediaWiki\Extension\WikiLambda\ZObjects\ZTypedList::getSerialized ( $form = self::FORM_CANONICAL)

@inheritDoc

Reimplemented from MediaWiki\Extension\WikiLambda\ZObjects\ZObject.

◆ isEmpty()

MediaWiki\Extension\WikiLambda\ZObjects\ZTypedList::isEmpty ( )

Returns true if it contains an empty list.

Returns
bool Whether it's an empty list

◆ isValid()

MediaWiki\Extension\WikiLambda\ZObjects\ZTypedList::isValid ( )

@inheritDoc

Reimplemented from MediaWiki\Extension\WikiLambda\ZObjects\ZObject.


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