]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/pocourl.php
Always naming it 'plugin' is not good, it can easily confuse. So better name it
[quix0rs-gnu-social.git] / lib / pocourl.php
index 786793b280d67e2ec53735eb4a1fb4bc8effcff6..e375f125a0a514ec612f2c71bc121af798e321df 100644 (file)
@@ -67,4 +67,24 @@ class PoCoURL
         }
         $xo->elementEnd('poco:urls');
     }
+
+    /**
+     * Return this PoCo URL as an array suitable for serializing in JSON
+     *
+     * @array $url the url
+     */
+
+    function asArray()
+    {
+        $url = array();
+
+        $url['type']  = $this->type;
+        $url['value'] = $this->value;
+
+        if (!empty($this->primary)) {
+            $url['primary'] = 'true';
+        }
+
+        return $url;
+    }
 }