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

Public Member Functions

 __construct (IConnectionProvider $dbProvider, TitleFactory $titleFactory, WikiPageFactory $wikiPageFactory, RevisionStore $revisionStore, UserGroupManager $userGroupManager, LoggerInterface $logger)
 
 getNextAvailableZid ()
 Find next available ZID in the database to create a new ZObject.
 
 getRevisionById (int $id)
 Load a page revision from a given revision ID number.
 
 fetchZObjectByTitle (Title $title, ?int $requestedRevision=null)
 Fetch the ZObject given its title and return it wrapped in a ZObjectContent object.
 
 fetchBatchZObjects ( $zids)
 Returns an array of ZPersistentObjects fetched from the DB given an array of their Zids.
 
 pushZObject (string $zid, string $data, string $summary)
 Push a given Object into the Database, without validation.
 
 createNewZObject (MessageLocalizer $context, string $data, string $summary, User $user)
 Create a new ZObject, with a newly assigned ZID, and store it in the Database.
 
 updateZObject (MessageLocalizer $context, string $zid, string $data, string $summary, User $user, int $flags=EDIT_UPDATE)
 Create or update a ZObject it in the Database.
 
 updateZObjectAsSystemUser (MessageLocalizer $context, string $zid, string $data, string $summary, int $flags=EDIT_UPDATE)
 Create or update a ZObject it in the Database as a System User.
 
 deleteZObjectLabelsByZid (string $zid)
 Delete the labels from the wikilambda_zobject_labels database that correspond to the given ZID.
 
 deleteZObjectLabelConflictsByZid (string $zid)
 Delete the label conflicts from the wikilambda_zobject_label_conflicts database that correspond to the given ZID.
 
 findZObjectLabelConflicts ( $zid, $ztype, $labels)
 Query the wikilambda_zobject_labels database for primary labels that have the same combination of language code and value for a different ZID than the given in the parameters.
 
 insertZObjectLabels ( $zid, $ztype, $labels, $returnType=null)
 Insert labels into the wikilambda_zobject_labels database for a given ZID and Type.
 
 insertZLanguageToLanguagesCache (string $zid, string $languageCode)
 Insert language code into the wikilambda_zlanguages database for a given ZID.
 
 insertZObjectLabelConflicts ( $zid, $conflicts)
 Insert label conflicts into the wikilambda_zobject_label_conflicts database for a given ZID.
 
 insertZObjectAliases ( $zid, $ztype, $aliases, $returnType=null)
 Insert alias (secondary labels) into the wikilambda_zobject_labels database for a given ZID and Type.
 
 fetchZidsOfType ( $ztype)
 Gets from the secondary database a list of all Zids belonging to a given type.
 
 fetchAllZids ()
 Get a list of all Zids persisted in the database.
 
 fetchAllZLanguageObjects ()
 Gets from the secondary database a list of all natural language ZIDs, mapping from BCP47 (or MediaWiki) language code to ZID (one zid can map to multiple BCP47 codes)
 
 fetchAllZLanguageCodes ()
 Gets from the secondary database a list of all supported natural BCP47 (or MediaWiki) language codes.
 
 findCodesFromZLanguage (string $zid)
 Gets from the secondary database the matching BCP47 (or MediaWiki) language code(s) for a given ZID.
 
 fetchAllZLanguagesWithLabels ( $userLang)
 Fetch all ZLanguages stored in the language cache table, and for each one, return its zid, its language code, and its label in the user language or the closest available fallback.
 
 fetchAllInstancedTypesWithLabels ( $userLang)
 Fetch all ZTypes that have persisted instances, with their label in the user language or the closest available fallback.
 
 fetchAllInstancedTypes ()
 Returns a list of distinct type Zids that have persisted instances.
 
 getPreferredLabelsQuery ( $languageChain)
 Generates a query that filters to the preferred label in the labels table, depending on the user's language fallback chain passed as parameter.
 
 getTestStatusQuery ()
 Generates a query that returns a table with all the existing test objects, their function, and their status:
 
 findZLanguageFromCode (string $code)
 Gets from the secondary database the ZID of a given BCP47 (or MediaWiki) language code.
 
 searchZObjectLabels ( $label, $exact, $languages, $type, $returnType, $strictReturnType, $continue, $limit)
 Search labels in the secondary database, filtering by language Zids, type or label string.
 
 fetchZObjectLabel ( $zid, $languageCode, $fallback=true)
 Fetch the label in the secondary database for a given object by Zid, in a given language.
 
 fetchZFunctionReturnType ( $zid)
 Get the return type of a given Function Zid or null if not available.
 
 findFirstZImplementationFunction ()
 Search implementations in the secondary database, return the first one This function is primarily used for the example API request.
 
 findReferencedZObjectsByZFunctionIdAsList ( $zid, $type)
 Converts findReferencedZObjectsByZFunctionId into a list of zids.
 
 findReferencedZObjectsByZFunctionId ( $zid, $type, $continue=null, $limit=10)
 Search implementations in the secondary database and return all matching a given ZID.
 
 fetchAllImplementations ()
 Fetch all objects of type Z14/Implementation persisted in the database, including connected, disconnected, labeled and unlabeled implementations.
 
 insertZFunctionReference ( $refId, $zFunctionId, $type)
 Add a record to the database for a given ZObject ID and ZFunction ID.
 
 deleteZFunctionReference ( $refId)
 Remove a given ZObject ref from the secondary database.
 
 findRelatedZObjectsByKeyAsList ( $mainZid, $key)
 For the given main ZObject and key, return the related ZObjects.
 
 findRelatedZObjectsByKey ( $mainZid, $key, $continue=null, $limit=10)
 For the given main ZObject and key, return the related ZObjects.
 
 insertRelatedZObjects ( $relatedZObjects)
 Add a batch of rows to the database describing the relation between a main ZObject and a related one, given by the connecting key.
 
 deleteRelatedZObjects (?string $mainZid, ?string $mainType=null, ?string $key=null, ?string $relatedZObject=null, ?string $relatedType=null)
 Delete all rows matching all of the non-null input values.
 
 findZTesterResult (?string $functionZID, ?int $functionRevision, ?string $implementationZID, ?int $implementationRevision, ?string $testerZID, ?int $testerRevision)
 Search test run results in the secondary tester results table; the latest result (highest database ID) will be used.
 
 insertZTesterResult (string $functionZID, int $functionRevision, string $implementationZID, int $implementationRevision, string $testerZID, int $testerRevision, bool $testerResult, string $testerResponse)
 Cache a test run result in the secondary tester results table.
 
 deleteZFunctionFromZTesterResultsCache (string $refId)
 Remove a given ZFunction's results from the secondary tester results table.
 
 deleteZImplementationFromZTesterResultsCache (string $refId)
 Remove a given ZImplementation's results from the secondary tester results table.
 
 deleteZTesterFromZTesterResultsCache (string $refId)
 Remove a given ZTester's results from the secondary tester results table.
 
 deleteZLanguageFromLanguagesCache (string $zid)
 Remove a given ZNaturalLanguage's entry from the secondary languages table.
 

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\WikiLambda\ZObjectStore::__construct ( IConnectionProvider $dbProvider,
TitleFactory $titleFactory,
WikiPageFactory $wikiPageFactory,
RevisionStore $revisionStore,
UserGroupManager $userGroupManager,
LoggerInterface $logger )
Parameters
IConnectionProvider$dbProvider
TitleFactory$titleFactory
WikiPageFactory$wikiPageFactory
RevisionStore$revisionStore
UserGroupManager$userGroupManager
LoggerInterface$logger

Member Function Documentation

◆ createNewZObject()

MediaWiki\Extension\WikiLambda\ZObjectStore::createNewZObject ( MessageLocalizer $context,
string $data,
string $summary,
User $user )

Create a new ZObject, with a newly assigned ZID, and store it in the Database.

Parameters
MessageLocalizer$contextThe context of the action operation, for localisation of messages
string$data
string$summary
User$user
Returns
ZObjectPage
+ Here is the call graph for this function:

◆ deleteRelatedZObjects()

MediaWiki\Extension\WikiLambda\ZObjectStore::deleteRelatedZObjects ( ?string $mainZid,
?string $mainType = null,
?string $key = null,
?string $relatedZObject = null,
?string $relatedType = null )

Delete all rows matching all of the non-null input values.

Parameters
?string$mainZidZID of the main ZObject
?string$mainTypeZID of the type of the main ZObject
?string$keyZID of a key indicating the relation between main and related ZObjects
?string$relatedZObjectThe related ZObject
?string$relatedTypeZID of the type of the related ZObject
Returns
void

◆ deleteZFunctionFromZTesterResultsCache()

MediaWiki\Extension\WikiLambda\ZObjectStore::deleteZFunctionFromZTesterResultsCache ( string $refId)

Remove a given ZFunction's results from the secondary tester results table.

Parameters
string$refIdthe ZID of the ZFunction whose results you wish to delete
Returns
void

◆ deleteZFunctionReference()

MediaWiki\Extension\WikiLambda\ZObjectStore::deleteZFunctionReference ( $refId)

Remove a given ZObject ref from the secondary database.

Parameters
string$refIdthe ZObject ID
Returns
void

◆ deleteZImplementationFromZTesterResultsCache()

MediaWiki\Extension\WikiLambda\ZObjectStore::deleteZImplementationFromZTesterResultsCache ( string $refId)

Remove a given ZImplementation's results from the secondary tester results table.

Parameters
string$refIdthe ZID of the ZImplementation whose results you wish to delete
Returns
void

◆ deleteZLanguageFromLanguagesCache()

MediaWiki\Extension\WikiLambda\ZObjectStore::deleteZLanguageFromLanguagesCache ( string $zid)

Remove a given ZNaturalLanguage's entry from the secondary languages table.

Parameters
string$zidthe ZID of the ZNaturalLanguage you wish to delete
Returns
void

◆ deleteZObjectLabelConflictsByZid()

MediaWiki\Extension\WikiLambda\ZObjectStore::deleteZObjectLabelConflictsByZid ( string $zid)

Delete the label conflicts from the wikilambda_zobject_label_conflicts database that correspond to the given ZID.

Parameters
string$zid

◆ deleteZObjectLabelsByZid()

MediaWiki\Extension\WikiLambda\ZObjectStore::deleteZObjectLabelsByZid ( string $zid)

Delete the labels from the wikilambda_zobject_labels database that correspond to the given ZID.

Parameters
string$zid

◆ deleteZTesterFromZTesterResultsCache()

MediaWiki\Extension\WikiLambda\ZObjectStore::deleteZTesterFromZTesterResultsCache ( string $refId)

Remove a given ZTester's results from the secondary tester results table.

Parameters
string$refIdthe ZID of the ZTester whose results you wish to delete
Returns
void

◆ fetchAllImplementations()

MediaWiki\Extension\WikiLambda\ZObjectStore::fetchAllImplementations ( )

Fetch all objects of type Z14/Implementation persisted in the database, including connected, disconnected, labeled and unlabeled implementations.

TODO (T287153): This method is only needed for the migrateZ16K1StringsToZ61s maintenance script, as using fetchZidsOfType(Z14) will not return those implementations that aren't labeled. Once we eliminate the maintenance script, we should remove this method, too.

Returns
array

◆ fetchAllInstancedTypes()

MediaWiki\Extension\WikiLambda\ZObjectStore::fetchAllInstancedTypes ( )

Returns a list of distinct type Zids that have persisted instances.

Returns
string[]

◆ fetchAllInstancedTypesWithLabels()

MediaWiki\Extension\WikiLambda\ZObjectStore::fetchAllInstancedTypesWithLabels ( $userLang)

Fetch all ZTypes that have persisted instances, with their label in the user language or the closest available fallback.

Parameters
string$userLang- User language BCP47 code
Returns
IResultWrapper

◆ fetchAllZids()

MediaWiki\Extension\WikiLambda\ZObjectStore::fetchAllZids ( )

Get a list of all Zids persisted in the database.

Returns
string[] All persisted Zids

◆ fetchAllZLanguageCodes()

MediaWiki\Extension\WikiLambda\ZObjectStore::fetchAllZLanguageCodes ( )

Gets from the secondary database a list of all supported natural BCP47 (or MediaWiki) language codes.

Returns
array<string>

◆ fetchAllZLanguageObjects()

MediaWiki\Extension\WikiLambda\ZObjectStore::fetchAllZLanguageObjects ( )

Gets from the secondary database a list of all natural language ZIDs, mapping from BCP47 (or MediaWiki) language code to ZID (one zid can map to multiple BCP47 codes)

Returns
array<string,string>

◆ fetchAllZLanguagesWithLabels()

MediaWiki\Extension\WikiLambda\ZObjectStore::fetchAllZLanguagesWithLabels ( $userLang)

Fetch all ZLanguages stored in the language cache table, and for each one, return its zid, its language code, and its label in the user language or the closest available fallback.

Parameters
string$userLang- User language BCP47 code
Returns
IResultWrapper

◆ fetchBatchZObjects()

MediaWiki\Extension\WikiLambda\ZObjectStore::fetchBatchZObjects ( $zids)

Returns an array of ZPersistentObjects fetched from the DB given an array of their Zids.

Note that this will only fetch the latest revision of a ZObject; if you want a specific revision, you need to use ZObjectStore::fetchZObjectByTitle() instead.

Parameters
string[]$zids
Returns
ZPersistentObject[]

◆ fetchZFunctionReturnType()

MediaWiki\Extension\WikiLambda\ZObjectStore::fetchZFunctionReturnType ( $zid)

Get the return type of a given Function Zid or null if not available.

Parameters
string$zid
Returns
string|null

◆ fetchZidsOfType()

MediaWiki\Extension\WikiLambda\ZObjectStore::fetchZidsOfType ( $ztype)

Gets from the secondary database a list of all Zids belonging to a given type.

Parameters
string$ztype
Returns
string[]

◆ fetchZObjectByTitle()

MediaWiki\Extension\WikiLambda\ZObjectStore::fetchZObjectByTitle ( Title $title,
?int $requestedRevision = null )

Fetch the ZObject given its title and return it wrapped in a ZObjectContent object.

Parameters
Title$titleThe ZObject to fetch
int | null$requestedRevisionThe revision ID of the page to fetch. If unset, the latest is returned.
Returns
ZObjectContent|bool Found ZObject

◆ fetchZObjectLabel()

MediaWiki\Extension\WikiLambda\ZObjectStore::fetchZObjectLabel ( $zid,
$languageCode,
$fallback = true )

Fetch the label in the secondary database for a given object by Zid, in a given language.

Returns null if no labels are found in the given language or any other language in that language's fallback chain, including English (Z1002). If the language code given is not recognised, this will fall back to returning the English label, if available.

Parameters
string$zidTerm to search in the label database
string$languageCodeCode of the language in which to fetch the label
bool$fallbackWhether to only match in the given language, or use the language fallback change (default behaviour).
Returns
string|null

◆ findCodesFromZLanguage()

MediaWiki\Extension\WikiLambda\ZObjectStore::findCodesFromZLanguage ( string $zid)

Gets from the secondary database the matching BCP47 (or MediaWiki) language code(s) for a given ZID.

Parameters
string$zidThe ZID of the matching ZLanguage object for which to search.
Returns
string[] Any BCP47 (or MediaWiki) language code(s) if found; unordered.

◆ findFirstZImplementationFunction()

MediaWiki\Extension\WikiLambda\ZObjectStore::findFirstZImplementationFunction ( )

Search implementations in the secondary database, return the first one This function is primarily used for the example API request.

Returns
string

◆ findReferencedZObjectsByZFunctionId()

MediaWiki\Extension\WikiLambda\ZObjectStore::findReferencedZObjectsByZFunctionId ( $zid,
$type,
$continue = null,
$limit = 10 )

Search implementations in the secondary database and return all matching a given ZID.

Parameters
string$zidthe ZID of the ZFunction
string$typethe type of the ZFunction reference
string | null$continueId to start. If null (the default), start from the first result.
int | null$limitMaximum number of results to return. Defaults to 10
Returns
IResultWrapper

◆ findReferencedZObjectsByZFunctionIdAsList()

MediaWiki\Extension\WikiLambda\ZObjectStore::findReferencedZObjectsByZFunctionIdAsList ( $zid,
$type )

Converts findReferencedZObjectsByZFunctionId into a list of zids.

Parameters
string$zidthe ZID of the ZFunction
string$typethe type of the ZFunction reference
Returns
string[] All ZIDs of referenced ZObjects associated to the ZFunction

◆ findRelatedZObjectsByKey()

MediaWiki\Extension\WikiLambda\ZObjectStore::findRelatedZObjectsByKey ( $mainZid,
$key,
$continue = null,
$limit = 10 )

For the given main ZObject and key, return the related ZObjects.

Related ZObjects may be ZIDs or string encodings of compound ZObjects, such as "Z881(Z6)" for typed list of strings.

Parameters
string$mainZidZID of the main ZObject
string$keyZID of the key that indicates the relationship
string | null$continueId to start. If null (the default), start from the first result.
int | null$limitMaximum number of results to return. Defaults to 10
Returns
IResultWrapper

◆ findRelatedZObjectsByKeyAsList()

MediaWiki\Extension\WikiLambda\ZObjectStore::findRelatedZObjectsByKeyAsList ( $mainZid,
$key )

For the given main ZObject and key, return the related ZObjects.

Related ZObjects may be ZIDs or string encodings of compound ZObjects, such as "Z881(Z6)" for typed list of strings.

Parameters
string$mainZidZID of the main ZObject
string$keyZID of the key that indicates the relationship
Returns
string[]

◆ findZLanguageFromCode()

MediaWiki\Extension\WikiLambda\ZObjectStore::findZLanguageFromCode ( string $code)

Gets from the secondary database the ZID of a given BCP47 (or MediaWiki) language code.

Parameters
string$codeThe BCP47 (or MediaWiki) language code for which to search
Returns
?string The ZID of the matching ZLanguage object, or null if not found.

◆ findZObjectLabelConflicts()

MediaWiki\Extension\WikiLambda\ZObjectStore::findZObjectLabelConflicts ( $zid,
$ztype,
$labels )

Query the wikilambda_zobject_labels database for primary labels that have the same combination of language code and value for a different ZID than the given in the parameters.

These will be considered conflicting labels.

Parameters
string$zid
string$ztype
array$labelsArray of labels, where the key is the language code and the value is the string representation of the label in that language
Returns
array Conflicts found in the wikilambda_zobject_labels database

◆ findZTesterResult()

MediaWiki\Extension\WikiLambda\ZObjectStore::findZTesterResult ( ?string $functionZID,
?int $functionRevision,
?string $implementationZID,
?int $implementationRevision,
?string $testerZID,
?int $testerRevision )

Search test run results in the secondary tester results table; the latest result (highest database ID) will be used.

Parameters
?string$functionZIDThe ZID of the ZFunction
?int$functionRevisionThe revision ID of the ZFunction
?string$implementationZIDThe ZID of the ZImplementation
?int$implementationRevisionThe revision ID of the ZImplementation
?string$testerZIDThe ZID of the ZTester
?int$testerRevisionThe revision ID of the ZTester
Returns
?ZResponseEnvelope

◆ getNextAvailableZid()

MediaWiki\Extension\WikiLambda\ZObjectStore::getNextAvailableZid ( )

Find next available ZID in the database to create a new ZObject.

Returns
string Next available ZID

◆ getPreferredLabelsQuery()

MediaWiki\Extension\WikiLambda\ZObjectStore::getPreferredLabelsQuery ( $languageChain)

Generates a query that filters to the preferred label in the labels table, depending on the user's language fallback chain passed as parameter.

Parameters
string[]$languageChainList of language zids in order of preference
Returns
string

◆ getRevisionById()

MediaWiki\Extension\WikiLambda\ZObjectStore::getRevisionById ( int $id)

Load a page revision from a given revision ID number.

Returns null if no such revision can be found.

Parameters
int$idRevision ID of this revision
Returns
RevisionRecord|null

◆ getTestStatusQuery()

MediaWiki\Extension\WikiLambda\ZObjectStore::getTestStatusQuery ( )

Generates a query that returns a table with all the existing test objects, their function, and their status:

  • is_connected: whether the test is connected to the function
  • is_passing: whether the test is passing against all the function's connected implementations
Returns
string

◆ insertRelatedZObjects()

MediaWiki\Extension\WikiLambda\ZObjectStore::insertRelatedZObjects ( $relatedZObjects)

Add a batch of rows to the database describing the relation between a main ZObject and a related one, given by the connecting key.

Example: [ 'Z401', 'Z8', 'Z8K2', 'Z881(Z6)', 'Z4' ] Indicates that the main object (Z401) of type function (Z8) has an output type (Z8K2) with value typed list of strings (Z881(Z6)) and type type (Z4)

Parameters
array$relatedZObjectsArray of rows to insert into the table. Each row must be an object with the non-empty properties zid, type, key, related_zid and related_type
Returns
void

◆ insertZFunctionReference()

MediaWiki\Extension\WikiLambda\ZObjectStore::insertZFunctionReference ( $refId,
$zFunctionId,
$type )

Add a record to the database for a given ZObject ID and ZFunction ID.

Parameters
string$refIdthe ZObject ref ID
string$zFunctionIdthe ZFunction ID
string$typethe type of the ZFunction reference
Returns
void|bool

◆ insertZLanguageToLanguagesCache()

MediaWiki\Extension\WikiLambda\ZObjectStore::insertZLanguageToLanguagesCache ( string $zid,
string $languageCode )

Insert language code into the wikilambda_zlanguages database for a given ZID.

Parameters
string$zid
string$languageCode
Returns
void|bool

◆ insertZObjectAliases()

MediaWiki\Extension\WikiLambda\ZObjectStore::insertZObjectAliases ( $zid,
$ztype,
$aliases,
$returnType = null )

Insert alias (secondary labels) into the wikilambda_zobject_labels database for a given ZID and Type.

Parameters
string$zid
string$ztype
array$aliasesSet of labels, where the key is the language code and the value is an array of strings
string | null$returnType
Returns
void|bool

◆ insertZObjectLabelConflicts()

MediaWiki\Extension\WikiLambda\ZObjectStore::insertZObjectLabelConflicts ( $zid,
$conflicts )

Insert label conflicts into the wikilambda_zobject_label_conflicts database for a given ZID.

Parameters
string$zid
array$conflictsArray of labels, where the key is the language code and the value is the other ZID for which this label is repeated
Returns
void|bool

◆ insertZObjectLabels()

MediaWiki\Extension\WikiLambda\ZObjectStore::insertZObjectLabels ( $zid,
$ztype,
$labels,
$returnType = null )

Insert labels into the wikilambda_zobject_labels database for a given ZID and Type.

Parameters
string$zid
string$ztype
array$labelsArray of labels, where the key is the language code and the value is the string representation of the label in that language
string | null$returnType
Returns
void|bool

◆ insertZTesterResult()

MediaWiki\Extension\WikiLambda\ZObjectStore::insertZTesterResult ( string $functionZID,
int $functionRevision,
string $implementationZID,
int $implementationRevision,
string $testerZID,
int $testerRevision,
bool $testerResult,
string $testerResponse )

Cache a test run result in the secondary tester results table.

Parameters
string$functionZIDThe ZID of the ZFunction
int$functionRevisionThe revision ID of the ZFunction
string$implementationZIDThe ZID of the ZImplementation
int$implementationRevisionThe revision ID of the ZImplementation
string$testerZIDThe ZID of the ZTester
int$testerRevisionThe revision ID of the ZTester
bool$testerResultWhether the test run passed (true) or failed (false)
string$testerResponseThe test run response JSON object
Returns
bool

◆ pushZObject()

MediaWiki\Extension\WikiLambda\ZObjectStore::pushZObject ( string $zid,
string $data,
string $summary )

Push a given Object into the Database, without validation.

Parameters
string$zid
string$data
string$summary
Returns
bool
Exceptions
Exception
+ Here is the call graph for this function:

◆ searchZObjectLabels()

MediaWiki\Extension\WikiLambda\ZObjectStore::searchZObjectLabels ( $label,
$exact,
$languages,
$type,
$returnType,
$strictReturnType,
$continue,
$limit )

Search labels in the secondary database, filtering by language Zids, type or label string.

Parameters
string$labelTerm to search in the label database
bool$exactWhether to search by exact match
string[]$languagesList of language Zids to filter by
string | null$typeZid of the type to filter by. If null, don't filter by type.
string | null$returnTypeZid of the return type to filter by. If null, don't filter by return type.
bool$strictReturnTypeWhether to exclude Z1s as return type.
string | null$continueId to start. If null, start from the first result.
int | null$limitMaximum number of results to return.
Returns
IResultWrapper

◆ updateZObject()

MediaWiki\Extension\WikiLambda\ZObjectStore::updateZObject ( MessageLocalizer $context,
string $zid,
string $data,
string $summary,
User $user,
int $flags = EDIT_UPDATE )

Create or update a ZObject it in the Database.

Parameters
MessageLocalizer$contextThe context of the action operation, for localisation of messages
string$zidThe ZID of the page to create/update, e.g. 'Z12345'
string$dataThe ZObject's JSON to store, in string form, i.e. "{ Z1K1: "Z2", Z2K1: … }"
string$summaryAn edit summary to display in the page's history, Recent Changes, watchlists, etc.
User$userThe user making the edit.
int$flagsEither EDIT_UPDATE (default) if editing or EDIT_NEW if creating a page
Returns
ZObjectPage
+ Here is the call graph for this function:

◆ updateZObjectAsSystemUser()

MediaWiki\Extension\WikiLambda\ZObjectStore::updateZObjectAsSystemUser ( MessageLocalizer $context,
string $zid,
string $data,
string $summary,
int $flags = EDIT_UPDATE )

Create or update a ZObject it in the Database as a System User.

Parameters
MessageLocalizer$contextThe context of the action operation, for localisation of messages
string$zid
string$data
string$summary
int$flags
Returns
ZObjectPage

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