Add Horde_Url::setRaw(), useful for chaining
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 7 Dec 2009 07:03:57 +0000 (00:03 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 7 Dec 2009 07:04:42 +0000 (00:04 -0700)
framework/Url/lib/Horde/Url.php
framework/Util/lib/Horde/Util.php

index 7136747..be1fabe 100644 (file)
@@ -184,6 +184,19 @@ class Horde_Url
     }
 
     /**
+     * Sets the $raw value.  This call can be chained.
+     *
+     * @param boolean  The value to set for $raw.
+     *
+     * @return Horde_Url  This object, to allow chaining.
+     */
+    public function setRaw($raw)
+    {
+        $this->raw = $raw;
+        return $this;
+    }
+
+    /**
      * Creates the full URL string.
      *
      * @return string  The string representation of this object.
index 6e20a47..607c7ec 100644 (file)
@@ -235,9 +235,7 @@ class Horde_Util
         }
 
         if ($url instanceof Horde_Url) {
-            $url2 = $url->cAdd($parameter, $value);
-            $url2->raw = !$encode;
-            return $url2;
+            return $url->cAdd($parameter, $value)->setRaw(!$encode);
         }
 
         $horde_url = new Horde_Url($url, !$encode);