diff options
-rw-r--r-- | engine/lib/entities.php | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php index ff997810c..720597a83 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -39,7 +39,12 @@ * Any field not appearing in this will be viewed as a */ protected $attributes; - +
+ /**
+ * If set, overrides the value of getURL()
+ */
+ protected $url_override;
+ /** * Temporary cache for metadata, permitting meta data access before a guid has obtained. */ @@ -437,7 +442,21 @@ * * @return string The URL */ - public function getURL() { return get_entity_url($this->getGUID()); } + public function getURL() {
+ if (!empty($this->url_override)) return $this->url_override;
+ return get_entity_url($this->getGUID());
+ }
+
+ /**
+ * Overrides the URL returned by getURL
+ *
+ * @param string $url The new item URL
+ * @return string The URL
+ */
+ public function setURL($url) {
+ $this->url_override = $url;
+ return $url;
+ } /** * Tests to see whether the object has been fully loaded. @@ -1450,7 +1469,7 @@ global $CONFIG; if ($entity = get_entity($entity_guid)) { - $url = ""; + $url = "";
if (isset($CONFIG->entity_url_handler[$entity->getType()][$entity->getSubType()])) { $function = $CONFIG->entity_url_handler[$entity->getType()][$entity->getSubType()]; |