Daniel Kinzler has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/70640


Change subject: Support for new ID serialization format
......................................................................

Support for new ID serialization format

Change-Id: I33b03d4bac6e3edd065f36b1c750b8d9fae09e63
---
M DataModel/DataModel/Entity/Entity.php
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/40/70640/1

diff --git a/DataModel/DataModel/Entity/Entity.php 
b/DataModel/DataModel/Entity/Entity.php
index 5e89d1f..e1bece1 100644
--- a/DataModel/DataModel/Entity/Entity.php
+++ b/DataModel/DataModel/Entity/Entity.php
@@ -165,7 +165,13 @@
        public function getId() {
                if ( $this->id === false ) {
                        if ( array_key_exists( 'entity', $this->data ) ) {
-                               $this->id = EntityId::newFromPrefixedId( 
$this->data['entity'] );
+                               $id = $this->data['entity'];
+
+                               if ( is_array( $id ) ) {
+                                       $this->id = new EntityId( $id[0], 
$id[1] );
+                               } else {
+                                       $this->id = 
EntityId::newFromPrefixedId( $id );
+                               }
                        }
                        else {
                                $this->id = null;

-- 
To view, visit https://gerrit.wikimedia.org/r/70640
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I33b03d4bac6e3edd065f36b1c750b8d9fae09e63
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: mw1.22-wmf6
Gerrit-Owner: Daniel Kinzler <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to