Functionality related to updating the page table should be moved from WikiPage into a stateley PageStore service. For this purpose, entries in the page table are to be repesented by PageRecord value objects.
Introducing a PageStore seems like a good opportunity to consolidate LinkCache with the internal title cache Logic in the Title class, and allow more code to be based on LinkTarget and PageIdentity without being bound to Title.
Ad hoc draft of service interfaces:
```lang=php
interface PageLookup {
function getPageById( int $pageId ) : ?PageRecord;
function getPage( PageIdentity $identity ) : ?PageRecord;
function getPageIdentity( int $namespace, string $name ) : PageIdentity;
}
interface PageBatchLookup {
function getPageBatch( array $rows ) : array; // PageRecord[]
function getPageIdentityBatch( array $rows ) : array; // PageIdentity[]
}
interface PageUpdaterFactory extends PageLookup {
function getPageUpdater( PageIdentity $page, User $actor ) : PageUpdater;
}
interface PageUpdaterBackend { // internal, for use with PageUpdater
function insertPageOn( PageIdentity $page, IDatabase $dbw );
function updateRevisionOn( PageIdentity $page, RevisionRecord $revision, IDatabase $dbw, $options = [] );
}
interface PageStateBackend { // internal, for use with LinksUpdate
function updateTouched( PageIdentity $page, string $timestamp = null );
}
```
Note that this does not block {T174038}, nor does it block {T194750}.