Jeroen De Dauw has uploaded a new change for review.

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


Change subject: Adding dataTypeId field to PropertyValueSnak [DNM]
......................................................................

Adding dataTypeId field to PropertyValueSnak [DNM]

Change-Id: I90460821c542ecf79a37a20b77be29a0c6da6ead
---
M lib/includes/serializers/SnakSerializer.php
1 file changed, 5 insertions(+), 18 deletions(-)


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

diff --git a/lib/includes/serializers/SnakSerializer.php 
b/lib/includes/serializers/SnakSerializer.php
index bd86221..7a31a9d 100644
--- a/lib/includes/serializers/SnakSerializer.php
+++ b/lib/includes/serializers/SnakSerializer.php
@@ -1,27 +1,14 @@
 <?php
 
 namespace Wikibase\Lib\Serializers;
+
 use MWException;
+use Wikibase\PropertyValueSnak;
 use Wikibase\Snak;
 use Wikibase\SnakObject;
 
 /**
  * Serializer for Snak objects.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
  *
  * @since 0.2
  *
@@ -54,13 +41,13 @@
 
                $serialization['property'] = 
$snak->getPropertyId()->getPrefixedId();
 
-               // TODO: we might want to include the data type of the property 
here as well
-
                if ( $snak->getType() === 'value' ) {
                        /**
-                        * @var \Wikibase\PropertyValueSnak $snak
+                        * @var PropertyValueSnak $snak
                         */
                        $serialization['datavalue'] = 
$snak->getDataValue()->toArray();
+
+                       $serialization['datatype'] = $snak->getDataTypeId();
                }
 
                return $serialization;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I90460821c542ecf79a37a20b77be29a0c6da6ead
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <[email protected]>

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

Reply via email to