-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REST: Create StatementUpdater interface
Bug: T342886 Change-Id: I3d3e802c618f38b9ab0c9513ce2940e647fb5da8
- Loading branch information
1 parent
c776607
commit 782b8c0
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php declare( strict_types=1 ); | ||
|
||
namespace Wikibase\Repo\RestApi\Domain\ReadModel; | ||
|
||
/** | ||
* @license GPL-2.0-or-later | ||
*/ | ||
class StatementRevision { | ||
|
||
private Statement $statement; | ||
/** | ||
* @var string timestamp in MediaWiki format 'YYYYMMDDhhmmss' | ||
*/ | ||
private string $lastModified; | ||
private int $revisionId; | ||
|
||
public function __construct( Statement $statement, string $lastModified, int $revisionId ) { | ||
$this->statement = $statement; | ||
$this->lastModified = $lastModified; | ||
$this->revisionId = $revisionId; | ||
} | ||
|
||
public function getStatement(): Statement { | ||
return $this->statement; | ||
} | ||
|
||
public function getLastModified(): string { | ||
return $this->lastModified; | ||
} | ||
|
||
public function getRevisionId(): int { | ||
return $this->revisionId; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php declare( strict_types=1 ); | ||
|
||
namespace Wikibase\Repo\RestApi\Domain\Services; | ||
|
||
use Wikibase\DataModel\Statement\Statement; | ||
use Wikibase\Repo\RestApi\Domain\Model\EditMetadata; | ||
use Wikibase\Repo\RestApi\Domain\ReadModel\StatementRevision; | ||
|
||
/** | ||
* @license GPL-2.0-or-later | ||
*/ | ||
interface StatementUpdater { | ||
|
||
public function update( Statement $statement, EditMetadata $editMetadata ): StatementRevision; | ||
|
||
} |