Abstract content object for articles representing Wikibase entities.
More...
|
const | EDIT_IGNORE_CONSTRAINTS = 1024 |
| Flag for use with EntityHandler::validateSave(), indicating that no pre-save validation should be applied.
|
|
Abstract content object for articles representing Wikibase entities.
For more information on the relationship between entities and wiki pages, see docs/entity-storage.wiki.
- Copyright
- GPL-2.0-or-later
- Author
- Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >
-
Daniel Kinzler
-
Bene* < benes.nosp@m.tar..nosp@m.wikim.nosp@m.edia.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >
@method \Wikibase\Repo\Content\EntityHandler getContentHandler()
◆ copy()
Wikibase\Repo\Content\EntityContent::copy |
( |
| ) |
|
- See also
- Content::copy
- Returns
- self
◆ equals()
Wikibase\Repo\Content\EntityContent::equals |
( |
?Content | $that = null | ) |
|
Both contents will be considered equal if they have the same ID and equal Entity data.
If one of the contents is considered "new", then matching IDs is not a criteria for them to be considered equal.
- See also
- Content::equals
- Parameters
-
- Returns
- bool
◆ getDiff()
Wikibase\Repo\Content\EntityContent::getDiff |
( |
EntityContent | $toContent | ) |
|
Returns a diff between this EntityContent and the given EntityContent.
- Parameters
-
- Returns
- EntityContentDiff
◆ getEntity()
Wikibase\Repo\Content\EntityContent::getEntity |
( |
| ) |
|
|
abstract |
◆ getEntityHolder()
Wikibase\Repo\Content\EntityContent::getEntityHolder |
( |
| ) |
|
|
abstract |
◆ getEntityId()
Wikibase\Repo\Content\EntityContent::getEntityId |
( |
| ) |
|
- Exceptions
-
RuntimeException | if the content object is empty or no entity ID is set |
- Returns
- EntityId
◆ getEntityPageProperties()
Wikibase\Repo\Content\EntityContent::getEntityPageProperties |
( |
| ) |
|
◆ getEntityRedirect()
Wikibase\Repo\Content\EntityContent::getEntityRedirect |
( |
| ) |
|
Returns the EntityRedirect represented by this EntityContent, or null if this EntityContent is not a redirect.
- Note
- This default implementation will fail if isRedirect() is true. Subclasses that support redirects must override getEntityRedirect().
- Exceptions
-
- Returns
- EntityRedirect|null
Reimplemented in Wikibase\Repo\Content\ItemContent.
◆ getIgnoreKeysForFilters()
Wikibase\Repo\Content\EntityContent::getIgnoreKeysForFilters |
( |
| ) |
|
|
abstractprotected |
◆ getNativeData()
Wikibase\Repo\Content\EntityContent::getNativeData |
( |
| ) |
|
- See also
- Content::getNativeData
- Note
- Avoid relying on this method! It bypasses EntityContentCodec, and does not make any guarantees about the structure of the array returned.
- Returns
- string[]|EntityDocument An undefined data structure representing the content. This is not guaranteed to conform to any serialization structure used in the database or externally.
◆ getPatchedCopy()
Returns a patched copy of this Content object.
- Parameters
-
- Exceptions
-
- Returns
- self
◆ getPatchedRedirect()
Wikibase\Repo\Content\EntityContent::getPatchedRedirect |
( |
Diff | $redirectPatch | ) |
|
|
private |
- Parameters
-
- Returns
- EntityRedirect|null
◆ getRedirectData()
Wikibase\Repo\Content\EntityContent::getRedirectData |
( |
| ) |
|
|
private |
Returns an array structure for the redirect represented by this EntityContent, if any.
- Note
- This may or may not be consistent with what EntityContentCodec does. It is intended to be used primarily for diffing.
- Returns
- string[]
◆ getRedirectText()
Wikibase\Repo\Content\EntityContent::getRedirectText |
( |
| ) |
|
|
protected |
- Returns
- string Returns the string representation of the redirect represented by this EntityContent (if any).
- Note
- Will fail if this EntityContent is not a redirect.
◆ getSize()
Wikibase\Repo\Content\EntityContent::getSize |
( |
| ) |
|
returns the content's nominal size in bogo-bytes.
- Returns
- int
◆ getTextForFilters()
Wikibase\Repo\Content\EntityContent::getTextForFilters |
( |
| ) |
|
- Returns
- string A string representing the content in a way useful for content filtering as performed by extensions like AbuseFilter.
◆ getTextForSearchIndex()
Wikibase\Repo\Content\EntityContent::getTextForSearchIndex |
( |
| ) |
|
◆ getTextForSummary()
Wikibase\Repo\Content\EntityContent::getTextForSummary |
( |
| $maxLength = 250 | ) |
|
Returns a textual representation of the content suitable for use in edit summaries and log messages.
- Parameters
-
int | $maxLength | maximum length of the summary text |
- Returns
- string
◆ getWikitextForTransclusion()
Wikibase\Repo\Content\EntityContent::getWikitextForTransclusion |
( |
| ) |
|
- Returns
- string|false The wikitext to include when another page includes this content, or false if the content is not includable in a wikitext page.
◆ isCountable()
Wikibase\Repo\Content\EntityContent::isCountable |
( |
| $hasLinks = null | ) |
|
- See also
- EntityContent::isCountable
- Parameters
-
- Returns
- bool True if this is not a redirect and the item is not empty.
◆ isEmpty()
Wikibase\Repo\Content\EntityContent::isEmpty |
( |
| ) |
|
◆ isValid()
Wikibase\Repo\Content\EntityContent::isValid |
( |
| ) |
|
- See also
- Content::isValid()
- Returns
- bool True if this content object is valid for saving. False if there is no entity, or the entity does not have an ID set.
Reimplemented in Wikibase\Repo\Content\PropertyContent.
◆ makeEmptyEntity()
Wikibase\Repo\Content\EntityContent::makeEmptyEntity |
( |
| ) |
|
|
private |
◆ EDIT_IGNORE_CONSTRAINTS
const Wikibase\Repo\Content\EntityContent::EDIT_IGNORE_CONSTRAINTS = 1024 |
Flag for use with EntityHandler::validateSave(), indicating that no pre-save validation should be applied.
Can be passed in via EditEntity::attemptSave, EntityStore::saveEntity, as well as WikiPage::doUserEditContent()
- Note
- : must not collide with the EDIT_XXX flags defined by MediaWiki core in Defines.php.
The documentation for this class was generated from the following file: