jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/355095 )

Change subject: Lua documentation: Loading a cached entity is not expensive
......................................................................


Lua documentation: Loading a cached entity is not expensive

See the local function getEntityObject in
client/includes/DataAccess/Scribunto/mw.wikibase.lua for details
about that.

Also applied changes done to the documentation on mediawiki.org:
https://www.mediawiki.org/w/index.php?diff=2370348

Change-Id: I724b05e92b5587d6fd9d6b54d282183e70265f60
---
M docs/lua.wiki
1 file changed, 6 insertions(+), 6 deletions(-)

Approvals:
  jenkins-bot: Verified
  Thiemo Mättig (WMDE): Looks good to me, approved



diff --git a/docs/lua.wiki b/docs/lua.wiki
index 86b262e..396ab65 100644
--- a/docs/lua.wiki
+++ b/docs/lua.wiki
@@ -8,7 +8,7 @@
 === mw.wikibase.getEntity ===
 <code>wikibase.getEntity()</code><br>
 <code>wikibase.getEntity( id )</code><br>
-:<span style="color: red;">This function is 
[[mw:Manual:$wgExpensiveParserFunctionLimit|expensive]] when called with the id 
of an entity not connected to the current page.</span>
+:<span style="color: red;">This function is 
[[mw:Manual:$wgExpensiveParserFunctionLimit|expensive]] when called with the ID 
of an entity not connected to the current page.</span> Loading entities doesn't 
count as expensive if the same entity is loaded twice during a module run. 
However, due to restrictions in the caching, if more than 14 other entities are 
loaded inbetween, the entity must be fetched again, which then counts as 
expensive.
 
 Gets a [[#mw.wikibase.entity|mw.wikibase.entity]] table with data of the 
Wikibase item requested by id. If no id was given, the item connected to the 
current page will be returned. Requesting an item by id is only supported if 
arbitrary access is enabled.
 
@@ -100,7 +100,7 @@
 
 An example call might look like this:
 <source lang="lua">
-local entity = mw.wikibase.getEntityObject()
+local entity = mw.wikibase.getEntity()
 local snak = entity['claims']['P342'][1]['qualifiers']['P342'][1]
 
 mw.wikibase.renderSnak( snak ) -- Returns the given Snak value formatted as 
wikitext escaped plain text.
@@ -112,7 +112,7 @@
 
 An example call might look like this:
 <source lang="lua">
-local entity = mw.wikibase.getEntityObject()
+local entity = mw.wikibase.getEntity()
 local snak = entity['claims']['P342'][1]['qualifiers']['P342'][1]
 
 mw.wikibase.formatValue( snak ) -- Returns the given Snak value formatted as 
rich wikitext.
@@ -124,7 +124,7 @@
 
 An example call might look like this:
 <source lang="lua">
-local entity = mw.wikibase.getEntityObject()
+local entity = mw.wikibase.getEntity()
 local snaks = entity['claims']['P342'][1]['qualifiers']
 
 mw.wikibase.renderSnaks( snaks ) -- Returns the given Snak values formatted as 
wikitext escaped plain text.
@@ -136,7 +136,7 @@
 
 An example call might look like this:
 <source lang="lua">
-local entity = mw.wikibase.getEntityObject()
+local entity = mw.wikibase.getEntity()
 local snaks = entity['claims']['P342'][1]['qualifiers']
 
 mw.wikibase.formatValues( snaks ) -- Returns the given Snak values formatted 
as rich wikitext.
@@ -171,7 +171,7 @@
 </source>
 
 == mw.wikibase.entity ==
-<code>mw.wikibase.entity</code> represents a Wikibase entity in Lua. A 
<code>mw.wikibase.entity</code> table for the item which is linked with the 
current page can be obtained with 
[[#mw.wikibase.getEntityObject|<code>mw.wikibase.getEntityObject</code>]].
+<code>mw.wikibase.entity</code> represents a Wikibase entity in Lua. A 
<code>mw.wikibase.entity</code> table for the item which is linked with the 
current page can be obtained with 
[[#mw.wikibase.getEntity|<code>mw.wikibase.getEntity</code>]].
 
 Functions documented as <code>mw.wikibase.entity.name</code> are available on 
the global <code>mw.wikibase.entity</code> table; functions documented as 
<code>mw.wikibase.entity:name</code> are methods of an 
<code>mw.wikibase.entity</code> object (see 
[[#mw.wikibase.entity.create|<code>mw.wikibase.entity.create</code>]]).
 

-- 
To view, visit https://gerrit.wikimedia.org/r/355095
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I724b05e92b5587d6fd9d6b54d282183e70265f60
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <h...@online.de>
Gerrit-Reviewer: Aude <aude.w...@gmail.com>
Gerrit-Reviewer: Hoo man <h...@online.de>
Gerrit-Reviewer: Lucie Kaffee <lucie.kaf...@gmail.com>
Gerrit-Reviewer: Matěj Suchánek <matejsuchane...@gmail.com>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to