X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fpocourl.php;h=e375f125a0a514ec612f2c71bc121af798e321df;hb=5a235ffbf905fe16105b5ecf9db3a040f04034b2;hp=786793b280d67e2ec53735eb4a1fb4bc8effcff6;hpb=8eb66467165e107d0c80c64f6c429fed1d1101d5;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; + } }