Skip to content

Commit

Permalink
Merge pull request #234 from wmde/addTermStore
Browse files Browse the repository at this point in the history
Add interfaces for writing Item/Property term stores
  • Loading branch information
Ladsgroup committed Feb 13, 2020
2 parents 0f7d403 + 78ad7a1 commit a183ea5
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Term/ItemTermStoreWriter.php
@@ -0,0 +1,21 @@
<?php

namespace Wikibase\DataModel\Services\Term;

use Wikibase\DataModel\Entity\ItemId;
use Wikibase\DataModel\Term\Fingerprint;

interface ItemTermStoreWriter {

/**
* Updates the stored terms for the specified item.
* @throws TermStoreException
*/
public function storeTerms( ItemId $itemId, Fingerprint $terms );

/**
* @throws TermStoreException
*/
public function deleteTerms( ItemId $itemId );

}
21 changes: 21 additions & 0 deletions src/Term/PropertyTermStoreWriter.php
@@ -0,0 +1,21 @@
<?php

namespace Wikibase\DataModel\Services\Term;

use Wikibase\DataModel\Entity\PropertyId;
use Wikibase\DataModel\Term\Fingerprint;

interface PropertyTermStoreWriter {

/**
* Updates the stored terms for the specified property.
* @throws TermStoreException
*/
public function storeTerms( PropertyId $propertyId, Fingerprint $terms );

/**
* @throws TermStoreException
*/
public function deleteTerms( PropertyId $propertyId );

}
7 changes: 7 additions & 0 deletions src/Term/TermStoreException.php
@@ -0,0 +1,7 @@
<?php

namespace Wikibase\DataModel\Services\Term;

class TermStoreException extends \RuntimeException {

}

0 comments on commit a183ea5

Please sign in to comment.