X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fpocoaddress.php;h=22d4d02b13d8d08e147c7d7b716d3978b22af084;hb=6e181a2454e888b09313344138f66713d5c9c99f;hp=d9f6ff2bdefa8ea988cbb6200a30c2ffa71bd0f7;hpb=d3b10959f4cbb9a195e93d0180fcc12ab7b7452e;p=quix0rs-gnu-social.git diff --git a/lib/pocoaddress.php b/lib/pocoaddress.php index d9f6ff2bde..22d4d02b13 100644 --- a/lib/pocoaddress.php +++ b/lib/pocoaddress.php @@ -56,4 +56,17 @@ class PoCoAddress $xo->elementEnd('poco:address'); } } + + /** + * Return this PoCo address as an array suitable for serializing in JSON + * + * @return array the address + */ + + function asArray() + { + if (!empty($this->formatted)) { + return array('formatted' => $this->formatted); + } + } }