X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fpocourl.php;h=e375f125a0a514ec612f2c71bc121af798e321df;hb=c4f60ab444ab4768d12c5a4e6de010b185da7528;hp=786793b280d67e2ec53735eb4a1fb4bc8effcff6;hpb=32eb4c5e2d13ff527494a1ca84e326fcf52cb5cb;p=quix0rs-gnu-social.git diff --git a/lib/pocourl.php b/lib/pocourl.php index 786793b280..e375f125a0 100644 --- a/lib/pocourl.php +++ b/lib/pocourl.php @@ -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; + } }