Storage interface for Entities.
More...
|
| assignFreshId (EntityDocument $entity) |
| Assigns a fresh ID to the given entity. More...
|
|
| saveEntity (EntityDocument $entity, $summary, User $user, $flags=0, $baseRevId=false, array $tags=[]) |
| Saves the given Entity to some underlying storage mechanism. More...
|
|
| saveRedirect (EntityRedirect $redirect, $summary, User $user, $flags=0, $baseRevId=false, array $tags=[]) |
| Saves the given EntityRedirect to some underlying storage mechanism. More...
|
|
| deleteEntity (EntityId $entityId, $reason, User $user) |
| Deletes the given entity in some underlying storage mechanism. More...
|
|
| userWasLastToEdit (User $user, EntityId $id, $lastRevId) |
| Check if no edits were made by other users since the given revision. More...
|
|
| updateWatchlist (User $user, EntityId $id, $watch) |
| Watches or unwatches the entity. More...
|
|
| isWatching (User $user, EntityId $id) |
| Determines whether the given user is watching the given item. More...
|
|
| canCreateWithCustomId (EntityId $id) |
| Whether an entity with the given custom ID can exist. More...
|
|
Storage interface for Entities.
- See also
- EntityLookup
-
EntityRevisionLookup
- Copyright
- GPL-2.0-or-later
- Author
- Daniel Kinzler
◆ assignFreshId()
Wikibase\Lib\Store\EntityStore::assignFreshId |
( |
EntityDocument |
$entity | ) |
|
◆ canCreateWithCustomId()
Wikibase\Lib\Store\EntityStore::canCreateWithCustomId |
( |
EntityId |
$id | ) |
|
◆ deleteEntity()
Wikibase\Lib\Store\EntityStore::deleteEntity |
( |
EntityId |
$entityId, |
|
|
|
$reason, |
|
|
User |
$user |
|
) |
| |
◆ isWatching()
Wikibase\Lib\Store\EntityStore::isWatching |
( |
User |
$user, |
|
|
EntityId |
$id |
|
) |
| |
◆ saveEntity()
Wikibase\Lib\Store\EntityStore::saveEntity |
( |
EntityDocument |
$entity, |
|
|
|
$summary, |
|
|
User |
$user, |
|
|
|
$flags = 0 , |
|
|
|
$baseRevId = false , |
|
|
array |
$tags = [] |
|
) |
| |
Saves the given Entity to some underlying storage mechanism.
- Note
- If the item does not have an ID yet (i.e. it was not yet created in the database), saveEntity() will fail with a edit-gone-missing message unless the EDIT_NEW bit is set in $flags. If EDIT_NEW is set and the Entity does not yet have an ID, a new ID is assigned using assignFreshId().
-
if the save is triggered by any kind of user interaction, consider using EditEntity::attemptSave(), which automatically handles edit conflicts, permission checks, etc.
- Parameters
-
EntityDocument | $entity | the entity to save. |
string | $summary | the edit summary for the new revision. |
User | $user | the user to whom to attribute the edit |
int | $flags | EDIT_XXX flags, as defined for WikiPage::doEditContent. Additionally, the EntityContent::EDIT_XXX constants can be used. |
int | bool | $baseRevId | the revision ID $entity is based on. Saving should fail if $baseRevId is no longer the current revision. |
string[] | $tags | Change tags to add to the edit. Callers are responsible for permission checks (typically using ChangeTags::canAddTagsAccompanyingChange). |
- See also
- WikiPage::doEditContent
- Returns
- EntityRevision
- Exceptions
-
Implemented in Wikibase\Repo\Store\Sql\WikiPageEntityStore, Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEntityStore, and Wikibase\Lib\Store\TypeDispatchingEntityStore.
◆ saveRedirect()
Wikibase\Lib\Store\EntityStore::saveRedirect |
( |
EntityRedirect |
$redirect, |
|
|
|
$summary, |
|
|
User |
$user, |
|
|
|
$flags = 0 , |
|
|
|
$baseRevId = false , |
|
|
array |
$tags = [] |
|
) |
| |
◆ updateWatchlist()
Wikibase\Lib\Store\EntityStore::updateWatchlist |
( |
User |
$user, |
|
|
EntityId |
$id, |
|
|
|
$watch |
|
) |
| |
◆ userWasLastToEdit()
Wikibase\Lib\Store\EntityStore::userWasLastToEdit |
( |
User |
$user, |
|
|
EntityId |
$id, |
|
|
|
$lastRevId |
|
) |
| |
The documentation for this interface was generated from the following file: