X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fpocoaddress.php;h=22d4d02b13d8d08e147c7d7b716d3978b22af084;hb=017eee8e5d7fb4c976032f6e1b14947254fc073e;hp=d9f6ff2bdefa8ea988cbb6200a30c2ffa71bd0f7;hpb=47f31bce47b182aa55c02c7872d7e473d3ab10f2;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); + } + } }