. * * @category Feed * @package StatusNet * @author Evan Prodromou * @author Zach Copley * @copyright 2010 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3 * @link http://status.net/ */ if (!defined('STATUSNET')) { exit(1); } class PoCoAddress { const ADDRESS = 'address'; const FORMATTED = 'formatted'; public $formatted; // @todo Other address fields function asString() { $xs = new XMLStringer(true); $this->outputTo($xs); return $xs->getString(); } function outputTo($xo) { if (!empty($this->formatted)) { $xo->elementStart('poco:address'); $xo->element('poco:formatted', null, common_xml_safe_str($this->formatted)); $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); } } }