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

Change subject: Implemented EntityContent::getParserOutput
......................................................................


Implemented EntityContent::getParserOutput

Change-Id: If57e55bbadafdf4d81b0f815980929182520cdad
---
M repo/includes/content/EntityContent.php
M repo/includes/content/ItemContent.php
M repo/includes/content/PropertyContent.php
3 files changed, 21 insertions(+), 42 deletions(-)

Approvals:
  Daniel Kinzler: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/content/EntityContent.php 
b/repo/includes/content/EntityContent.php
index e46f01f..fb1e028 100644
--- a/repo/includes/content/EntityContent.php
+++ b/repo/includes/content/EntityContent.php
@@ -2,7 +2,8 @@
 
 namespace Wikibase;
 
-use WikiPage, Title, User, Status;
+use WikiPage, Title, User, Status, ParserOptions;
+use \ValueFormatters\ValueFormatterFactory;
 
 /**
  * Abstract content object for articles representing Wikibase entities.
@@ -125,6 +126,25 @@
        public abstract function getEntity();
 
        /**
+        * Returns a ParserOutput object containing the HTML.
+        *
+        * @since 0.1
+        *
+        * @param Title $title
+        * @param null $revId
+        * @param null|ParserOptions $options
+        * @param bool $generateHtml
+        *
+        * @return ParserOutput
+        */
+       public function getParserOutput( Title $title, $revId = null, 
ParserOptions $options = null, $generateHtml = true )  {
+               $valueFormatters = new ValueFormatterFactory( 
$GLOBALS['wgValueFormatters'] );
+
+               $entityView = EntityView::newForEntityContent( $this, 
$valueFormatters );;
+               return $entityView->getParserOutput( $this, $options, 
$generateHtml );
+       }
+
+       /**
         * @return String a string representing the content in a way useful for 
building a full text
         *         search index.
         */
diff --git a/repo/includes/content/ItemContent.php 
b/repo/includes/content/ItemContent.php
index 543744e..c2f763f 100644
--- a/repo/includes/content/ItemContent.php
+++ b/repo/includes/content/ItemContent.php
@@ -2,7 +2,6 @@
 
 namespace Wikibase;
 use Title, WikiPage, User, MWException, Content, Status, ParserOptions, 
ParserOutput, DataUpdate;
-use \ValueFormatters\ValueFormatterFactory;
 
 /**
  * Content object for articles representing Wikibase items.
@@ -266,24 +265,4 @@
                        array( new ItemModificationUpdate( $this ) )
                );
        }
-
-       /**
-        * Returns a ParserOutput object containing the HTML.
-        *
-        * @since 0.1
-        *
-        * @param Title              $title
-        * @param null               $revId
-        * @param null|ParserOptions $options
-        * @param bool               $generateHtml
-        *
-        * @return \Title
-        */
-       public function getParserOutput( Title $title, $revId = null, 
ParserOptions $options = null, $generateHtml = true )  {
-               $valueFormatters = new ValueFormatterFactory( 
$GLOBALS['wgValueFormatters'] );
-
-               $itemView = new ItemView( $valueFormatters );
-               return $itemView->getParserOutput( $this, $options, 
$generateHtml );
-       }
-
 }
diff --git a/repo/includes/content/PropertyContent.php 
b/repo/includes/content/PropertyContent.php
index 48f495c..7f6f947 100644
--- a/repo/includes/content/PropertyContent.php
+++ b/repo/includes/content/PropertyContent.php
@@ -199,24 +199,4 @@
                        )
                );
        }
-
-       /**
-        * Returns a ParserOutput object containing the HTML.
-        *
-        * @since 0.1
-        *
-        * @param Title $title
-        * @param null $revId
-        * @param null|ParserOptions $options
-        * @param bool $generateHtml
-        *
-        * @return ParserOutput
-        */
-       public function getParserOutput( Title $title, $revId = null, 
ParserOptions $options = null, $generateHtml = true )  {
-               $valueFormatters = new ValueFormatterFactory( 
$GLOBALS['wgValueFormatters'] );
-
-               $propertyView = new PropertyView( $valueFormatters );
-               return $propertyView->getParserOutput( $this, $options, 
$generateHtml );
-       }
-
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If57e55bbadafdf4d81b0f815980929182520cdad
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Werner <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Daniel Werner <[email protected]>
Gerrit-Reviewer: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to