diff --git "a/include/class-wb\\DataValueExternalID.php" "b/include/class-wb\\DataValueExternalID.php" new file mode 100644 index 0000000..41dad04 --- /dev/null +++ "b/include/class-wb\\DataValueExternalID.php" @@ -0,0 +1,26 @@ +. + +# Wikibase +namespace wb; + +/** + * A DataValue for an external identifier + * + * To be honest, it does not exist any DataValue for external identifiers. + */ +class DataValueExternalID extends DataValueString {} diff --git "a/include/class-wb\\SnakExternalID.php" "b/include/class-wb\\SnakExternalID.php" new file mode 100644 index 0000000..af70cf5 --- /dev/null +++ "b/include/class-wb\\SnakExternalID.php" @@ -0,0 +1,38 @@ +. + +# Wikibase +namespace wb; + +/** + * A Snak for an external identifier + */ +class SnakExternalID extends Snak { + + /** + * @param $property string Wikidata property as 'P123' + * @param $value string + */ + public function __construct( $property, $value ) { + return parent::__construct( + 'value', + $property, + DataType::EXTERNAL_ID, + new DataValueExternalID( $value ) + ); + } +} diff --git "a/include/class-wb\\StatementExternalID.php" "b/include/class-wb\\StatementExternalID.php" new file mode 100644 index 0000000..8718372 --- /dev/null +++ "b/include/class-wb\\StatementExternalID.php" @@ -0,0 +1,33 @@ +. + +# Wikibase +namespace wb; + +/** + * A Statement that contains a SnakString. + */ +class StatementExternalID extends Statement { + + /** + * @param $property string Property as 'P123' + * @param $s string Value as 'ASD' + */ + public function __construct( $property, $s ) { + parent::__construct( new SnakExternalID( $property, $s ) ); + } +}