Skip to content

Commit

Permalink
REST: Create StatementUpdater interface
Browse files Browse the repository at this point in the history
Bug: T342886
Change-Id: I3d3e802c618f38b9ab0c9513ce2940e647fb5da8
  • Loading branch information
MuhammadJaziraly authored and outdooracorn committed Aug 4, 2023
1 parent c776607 commit 782b8c0
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
34 changes: 34 additions & 0 deletions repo/rest-api/src/Domain/ReadModel/StatementRevision.php
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;
}
}
16 changes: 16 additions & 0 deletions repo/rest-api/src/Domain/Services/StatementUpdater.php
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;

}

0 comments on commit 782b8c0

Please sign in to comment.