12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- if (!defined('STATUSNET')) {
- exit(1);
- }
- class PoCoAddress
- {
- const ADDRESS = 'address';
- const FORMATTED = 'formatted';
- public $formatted;
-
- 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');
- }
- }
-
- function asArray()
- {
- if (!empty($this->formatted)) {
- return array('formatted' => $this->formatted);
- }
- }
- }
|