Skip to content

Commit 3bc2f98

Browse files
committed
Merge pull request #513 from wmde/labelsprovider
Introduce provider interfaces for labels, descriptions and aliases
2 parents 9074855 + 370edf0 commit 3bc2f98

5 files changed

Lines changed: 62 additions & 1 deletion

File tree

RELEASE-NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
* Added `StatementFilter` and `ReferencedStatementFilter`
66
* Added `StatementList::filter`
7+
* Added `LabelsProvider`, `DescriptionsProvider` and `AliasesProvider`
78

89
## Version 4.0 (2015-07-28)
910

src/Term/AliasesProvider.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace Wikibase\DataModel\Term;
4+
5+
/**
6+
* @since 4.1
7+
*
8+
* @licence GNU GPL v2+
9+
* @author Bene* < benestar.wikimedia@gmail.com >
10+
*/
11+
interface AliasesProvider {
12+
13+
/**
14+
* It is not guaranteed that this method returns the original object.
15+
*
16+
* @return AliasGroupList
17+
*/
18+
public function getAliasGroups();
19+
20+
}

src/Term/DescriptionsProvider.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace Wikibase\DataModel\Term;
4+
5+
/**
6+
* @since 4.1
7+
*
8+
* @licence GNU GPL v2+
9+
* @author Bene* < benestar.wikimedia@gmail.com >
10+
*/
11+
interface DescriptionsProvider {
12+
13+
/**
14+
* It is not guaranteed that this method returns the original object.
15+
*
16+
* @return TermList
17+
*/
18+
public function getDescriptions();
19+
20+
}

src/Term/Fingerprint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
1414
* @author Thiemo Mättig
1515
*/
16-
class Fingerprint implements Comparable {
16+
class Fingerprint implements Comparable, LabelsProvider, DescriptionsProvider, AliasesProvider {
1717

1818
/**
1919
* @deprecated since 2.5, use new Fingerprint() instead.

src/Term/LabelsProvider.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace Wikibase\DataModel\Term;
4+
5+
/**
6+
* @since 4.1
7+
*
8+
* @licence GNU GPL v2+
9+
* @author Bene* < benestar.wikimedia@gmail.com >
10+
*/
11+
interface LabelsProvider {
12+
13+
/**
14+
* It is not guaranteed that this method returns the original object.
15+
*
16+
* @return TermList
17+
*/
18+
public function getLabels();
19+
20+
}

0 commit comments

Comments
 (0)