Wikibase
MediaWiki Wikibase extension
|
EntityStore implementation based on WikiPage. More...
Public Member Functions | |
__construct (EntityContentFactory $contentFactory, EntityTitleStoreLookup $entityTitleStoreLookup, IdGenerator $idGenerator, EntityIdComposer $entityIdComposer, RevisionStore $revisionStore, DatabaseEntitySource $entitySource, ActorNormalization $actorNormalization, PermissionManager $permissionManager, WatchlistManager $watchlistManager, WikiPageFactory $wikiPageFactory, RepoDomainDb $repoDomainDb) | |
assignFreshId (EntityDocument $entity) | |
canCreateWithCustomId (EntityId $id) | |
registerWatcher (EntityStoreWatcher $watcher) | |
Registers a watcher that will be notified whenever an entity is updated or deleted. | |
getWikiPageForEntity (EntityId $entityId) | |
Returns the WikiPage object for the item with provided entity. | |
saveEntity (EntityDocument $entity, $summary, User $user, $flags=0, $baseRevId=false, array $tags=[]) | |
saveRedirect (EntityRedirect $redirect, $summary, User $user, $flags=0, $baseRevId=false, array $tags=[]) | |
deleteEntity (EntityId $entityId, $reason, User $user) | |
Deletes the given entity in some underlying storage mechanism. | |
userWasLastToEdit (User $user, EntityId $id, $lastRevId) | |
Check if no edits were made by other users since the given revision. | |
updateWatchlist (User $user, EntityId $id, $watch) | |
Watches or unwatches the entity. | |
isWatching (User $user, EntityId $id) | |
Determines whether the given user is watching the given item. | |
Private Member Functions | |
assertCanStoreEntity (EntityId $id) | |
assertEntityIdFromKnownSource (EntityId $id) | |
entityIdFromKnownSource (EntityId $id) | |
saveEntityContent (EntityContent $entityContent, User $user, $summary='', $flags=0, $baseRevId=false, array $tags=[]) | |
Saves the entity. | |
adjustFlagsForMCR ( $flags, $parentRevision, $slotRole) | |
getTitleForEntity (EntityId $entityId) | |
Private Attributes | |
$contentFactory | |
$entityTitleStoreLookup | |
$idGenerator | |
$dispatcher | |
$entityIdComposer | |
$revisionStore | |
$entitySource | |
ActorNormalization | $actorNormalization |
$permissionManager | |
$watchlistManager | |
$wikiPageFactory | |
$db | |
EntityStore implementation based on WikiPage.
For more information on the relationship between entities and wiki pages, see docs/entity-storage.wiki.
Wikibase\Repo\Store\Sql\WikiPageEntityStore::__construct | ( | EntityContentFactory | $contentFactory, |
EntityTitleStoreLookup | $entityTitleStoreLookup, | ||
IdGenerator | $idGenerator, | ||
EntityIdComposer | $entityIdComposer, | ||
RevisionStore | $revisionStore, | ||
DatabaseEntitySource | $entitySource, | ||
ActorNormalization | $actorNormalization, | ||
PermissionManager | $permissionManager, | ||
WatchlistManager | $watchlistManager, | ||
WikiPageFactory | $wikiPageFactory, | ||
RepoDomainDb | $repoDomainDb ) |
EntityContentFactory | $contentFactory | |
EntityTitleStoreLookup | $entityTitleStoreLookup | |
IdGenerator | $idGenerator | |
EntityIdComposer | $entityIdComposer | |
RevisionStore | $revisionStore | A RevisionStore for the local database. |
DatabaseEntitySource | $entitySource | |
ActorNormalization | $actorNormalization | |
PermissionManager | $permissionManager | |
WatchlistManager | $watchlistManager | |
WikiPageFactory | $wikiPageFactory | |
RepoDomainDb | $repoDomainDb |
|
private |
int | $flags | |
RevisionRecord | null | $parentRevision | |
string | $slotRole |
StorageException |
If the flags indicate a new edit, and the page already exists and we are interacting with a slot other than the main slot, adjust the slots for the MCR save. If we are interacting with the main slot, keep the NEW flag. This is consistent with previous behaviour.
|
private |
|
private |
Wikibase\Repo\Store\Sql\WikiPageEntityStore::assignFreshId | ( | EntityDocument | $entity | ) |
EntityDocument | $entity |
StorageException | |
InvalidArgumentException |
Implements Wikibase\Lib\Store\EntityStore.
Wikibase\Repo\Store\Sql\WikiPageEntityStore::canCreateWithCustomId | ( | EntityId | $id | ) |
EntityId | $id |
StorageException |
Implements Wikibase\Lib\Store\EntityStore.
Wikibase\Repo\Store\Sql\WikiPageEntityStore::deleteEntity | ( | EntityId | $entityId, |
$reason, | |||
User | $user ) |
Deletes the given entity in some underlying storage mechanism.
EntityId | $entityId | |
string | $reason | the reason for deletion |
User | $user |
InvalidArgumentException | |
StorageException |
Implements Wikibase\Lib\Store\EntityStore.
|
private |
|
private |
EntityId | $entityId |
Wikibase\Repo\Store\Sql\WikiPageEntityStore::getWikiPageForEntity | ( | EntityId | $entityId | ) |
Returns the WikiPage object for the item with provided entity.
EntityId | $entityId |
InvalidArgumentException | |
StorageException |
Wikibase\Repo\Store\Sql\WikiPageEntityStore::isWatching | ( | User | $user, |
EntityId | $id ) |
Determines whether the given user is watching the given item.
User | $user | |
EntityId | $id | the entity to watch |
InvalidArgumentException | for foreign EntityIds as watching foreign entities is not yet supported |
Implements Wikibase\Lib\Store\EntityStore.
Wikibase\Repo\Store\Sql\WikiPageEntityStore::registerWatcher | ( | EntityStoreWatcher | $watcher | ) |
Registers a watcher that will be notified whenever an entity is updated or deleted.
EntityStoreWatcher | $watcher |
Wikibase\Repo\Store\Sql\WikiPageEntityStore::saveEntity | ( | EntityDocument | $entity, |
$summary, | |||
User | $user, | ||
$flags = 0, | |||
$baseRevId = false, | |||
array | $tags = [] ) |
EntityDocument | $entity | |
string | $summary | |
User | $user | |
int | $flags | |
int | bool | $baseRevId | |
string[] | $tags |
InvalidArgumentException | |
StorageException |
Implements Wikibase\Lib\Store\EntityStore.
|
private |
Saves the entity.
If the corresponding page does not exist yet, it will be created (ie a new ID will be determined and a new page in the data NS created).
EntityContent | $entityContent | the entity to save. |
User | $user | |
string | $summary | |
int | $flags | Flags as used by WikiPage::doEditContent, use EDIT_XXX constants. |
int | bool | $baseRevId | |
string[] | $tags |
StorageException |
Wikibase\Repo\Store\Sql\WikiPageEntityStore::saveRedirect | ( | EntityRedirect | $redirect, |
$summary, | |||
User | $user, | ||
$flags = 0, | |||
$baseRevId = false, | |||
array | $tags = [] ) |
EntityRedirect | $redirect | |
string | $summary | |
User | $user | |
int | $flags | |
int | bool | $baseRevId | |
string[] | $tags |
InvalidArgumentException | |
StorageException |
Implements Wikibase\Lib\Store\EntityStore.
Wikibase\Repo\Store\Sql\WikiPageEntityStore::updateWatchlist | ( | User | $user, |
EntityId | $id, | ||
$watch ) |
Watches or unwatches the entity.
User | $user | |
EntityId | $id | the entity to watch |
bool | $watch | whether to watch or unwatch the page. |
InvalidArgumentException |
Implements Wikibase\Lib\Store\EntityStore.
Wikibase\Repo\Store\Sql\WikiPageEntityStore::userWasLastToEdit | ( | User | $user, |
EntityId | $id, | ||
$lastRevId ) |
Check if no edits were made by other users since the given revision.
This makes the assumption that revision ids are monotonically increasing.
User | $user | |
EntityId | $id | the entity to check (ignored by this implementation) |
int | $lastRevId | the revision the user supplied |
InvalidArgumentException |
Implements Wikibase\Lib\Store\EntityStore.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |