Add ParentPageLocation class
authorMatthias Schmidt <gravatronics@live.com>
Thu, 15 Sep 2016 16:58:26 +0000 (18:58 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Thu, 15 Sep 2016 16:58:26 +0000 (18:58 +0200)
wcfsetup/install/files/lib/system/page/ParentPageLocation.class.php [new file with mode: 0644]

diff --git a/wcfsetup/install/files/lib/system/page/ParentPageLocation.class.php b/wcfsetup/install/files/lib/system/page/ParentPageLocation.class.php
new file mode 100644 (file)
index 0000000..570f643
--- /dev/null
@@ -0,0 +1,52 @@
+<?php
+namespace wcf\system\page;
+use wcf\data\ITitledLinkObject;
+
+/**
+ * Parent page location representation implementing the required `ITitledLinkObject` interface
+ * to properly handle certain edge cases. 
+ * 
+ * @author     Matthias Schmidt
+ * @copyright  2001-2016 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    WoltLabSuite\Core\System\Page
+ * @since      3.0
+ */
+class ParentPageLocation implements ITitledLinkObject {
+       /**
+        * link of the parent page location
+        * @var string
+        */
+       public $link;
+       
+       /**
+        * title of the parent page location
+        * @var string
+        */
+       protected $title;
+       
+       /**
+        * ParentPageLocation constructor.
+        * 
+        * @param       string          $title          title of the parent page location
+        * @param       string          $link           link of the parent page location
+        */
+       public function __construct($title, $link) {
+               $this->title = $title;
+               $this->link = $link;
+       }
+       
+       /**
+        * @inheritDoc
+        */
+       public function getLink() {
+               return $this->link;
+       }
+       
+       /**
+        * @inheritDoc
+        */
+       public function getTitle() {
+               return $this->title;
+       }
+}