summaryrefslogtreecommitdiff
path: root/lib/pocoaddress.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-22 13:56:16 -0700
committerBrion Vibber <brion@pobox.com>2010-03-22 13:56:16 -0700
commite89908f26140c217e01b2f8f755712f38f3935f3 (patch)
tree6b241fc2e33f3528cf48b415ef67906826b02e24 /lib/pocoaddress.php
parent714d920faea302b55857cc3bec4e9e6160ea136a (diff)
parenteb563937df921e5fc67ca0c87e229feb2907fd19 (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 1.0.x
Conflicts: lib/channel.php scripts/imdaemon.php
Diffstat (limited to 'lib/pocoaddress.php')
-rw-r--r--lib/pocoaddress.php56
1 files changed, 56 insertions, 0 deletions
diff --git a/lib/pocoaddress.php b/lib/pocoaddress.php
new file mode 100644
index 000000000..60873bdc4
--- /dev/null
+++ b/lib/pocoaddress.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ * StatusNet, the distributed open-source microblogging tool
+ *
+ * An activity
+ *
+ * PHP version 5
+ *
+ * LICENCE: This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category Feed
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @author Zach Copley <zach@status.net>
+ * @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()
+ {
+ if (!empty($this->formatted)) {
+ $xs = new XMLStringer(true);
+ $xs->elementStart('poco:address');
+ $xs->element('poco:formatted', null, common_xml_safe_str($this->formatted));
+ $xs->elementEnd('poco:address');
+ return $xs->getString();
+ }
+
+ return null;
+ }
+}