jenkins-bot has submitted this change and it was merged.

Change subject: DM 1.0 compat: do not use EntityId constructor
......................................................................


DM 1.0 compat: do not use EntityId constructor

Change-Id: I8f40d349a909903fd97ddc707fa24b015b925134
---
M lib/includes/store/sql/TermSqlIndex.php
1 file changed, 8 insertions(+), 11 deletions(-)

Approvals:
  WikidataJenkins: Verified
  Thiemo Mättig (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/includes/store/sql/TermSqlIndex.php 
b/lib/includes/store/sql/TermSqlIndex.php
index a6613e1..d72848e 100644
--- a/lib/includes/store/sql/TermSqlIndex.php
+++ b/lib/includes/store/sql/TermSqlIndex.php
@@ -7,7 +7,7 @@
 use Iterator;
 use MWException;
 use ResultWrapper;
-use Wikibase\DataModel\Entity\BasicEntityIdParser;
+use Wikibase\DataModel\LegacyIdInterpreter;
 
 /**
  * Term lookup cache.
@@ -571,13 +571,12 @@
 
                $this->releaseConnection( $db );
 
-               $idParser = new BasicEntityIdParser();
+               $idParser = new LegacyIdInterpreter();
+
                $entityIds = array_map(
                        function( $entity ) use ( $idParser ) {
-                               // FIXME: this is using the deprecated EntityId 
constructor and a hack to get the
-                               // correct EntityId type that will not work for 
entity types other then item and property.
-                               $entityId = new EntityId( 
$entity->term_entity_type, (int)$entity->term_entity_id );
-                               $entityId = $idParser->parse( 
$entityId->getSerialization() );
+                               // FIXME: this only works for items and 
properties
+                               $entityId = $idParser->newIdFromTypeAndNumber( 
$entity->term_entity_type, (int)$entity->term_entity_id );
                                return $entityId;
                        },
                        iterator_to_array( $entities )
@@ -721,13 +720,11 @@
 
                // turn numbers into entity ids
                $result = array();
-               $idParser = new BasicEntityIdParser();
+               $idParser = new LegacyIdInterpreter();
 
                foreach ( $numericIds as $numericId ) {
-                       // FIXME: this is using the deprecated EntityId 
constructor and a hack to get the
-                       // correct EntityId type that will not work for entity 
types other then item and property.
-                       $entityId = new EntityId( $entityType, $numericId );
-                       $result[] = $idParser->parse( 
$entityId->getSerialization() );
+                       // FIXME: this only works for items and properties
+                       $result[] = $idParser->newIdFromTypeAndNumber( 
$entityType, $numericId );
                }
 
                wfProfileOut( __METHOD__ );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8f40d349a909903fd97ddc707fa24b015b925134
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: WikidataJenkins <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to