Add ILinkableObject to PageContent
authorJoshua Rüsweg <josh@bastelstu.be>
Sun, 11 Jun 2017 13:55:54 +0000 (15:55 +0200)
committerJoshua Rüsweg <josh@bastelstu.be>
Sun, 11 Jun 2017 14:09:02 +0000 (16:09 +0200)
See #2286

wcfsetup/install/files/lib/data/page/content/PageContent.class.php

index bddac4ed261b6a36ea9fad0c249c576bc8565722..75e17f7d51d9373640f2c0e2c050308933abe348 100644 (file)
@@ -1,9 +1,11 @@
 <?php
 namespace wcf\data\page\content;
 use wcf\data\DatabaseObject;
+use wcf\data\ILinkableObject;
 use wcf\system\html\output\HtmlOutputProcessor;
 use wcf\system\html\simple\HtmlSimpleParser;
 use wcf\system\message\embedded\object\MessageEmbeddedObjectManager;
+use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
 
 /**
@@ -25,7 +27,7 @@ use wcf\system\WCF;
  * @property-read      string          $customURL              custom url of the page in the associated language
  * @property-read      integer         $hasEmbeddedObjects     is `1` if the page content contains embedded objects, otherwise `0`
  */
-class PageContent extends DatabaseObject {
+class PageContent extends DatabaseObject implements ILinkableObject {
        /**
         * @inheritDoc
         */
@@ -111,4 +113,11 @@ class PageContent extends DatabaseObject {
                
                return null;
        }
+       
+       /**
+        * @inheritDoc
+        */
+       public function getLink() {
+               return LinkHandler::getInstance()->getCmsLink($this->pageID, $this->languageID);
+       }
 }