let callers pass in an XMLOutputter to output to

This commit is contained in:
Evan Prodromou 2011-01-02 15:21:56 -08:00
parent 1997044589
commit 810304159e

View File

@ -322,6 +322,7 @@ class Activity
* *
* @return DOMElement Atom entry * @return DOMElement Atom entry
*/ */
function toAtomEntry() function toAtomEntry()
{ {
return null; return null;
@ -330,7 +331,12 @@ class Activity
function asString($namespace=false, $author=true, $source=false) function asString($namespace=false, $author=true, $source=false)
{ {
$xs = new XMLStringer(true); $xs = new XMLStringer(true);
$this->outputTo($xs, $namespace, $author, $source);
return $xs->getString();
}
function outputTo($xs, $namespace=false, $author=true, $source=false)
{
if ($namespace) { if ($namespace) {
$attrs = array('xmlns' => 'http://www.w3.org/2005/Atom', $attrs = array('xmlns' => 'http://www.w3.org/2005/Atom',
'xmlns:thr' => 'http://purl.org/syndication/thread/1.0', 'xmlns:thr' => 'http://purl.org/syndication/thread/1.0',
@ -518,9 +524,7 @@ class Activity
$xs->elementEnd('entry'); $xs->elementEnd('entry');
$str = $xs->getString(); return;
return $str;
} }
private function _child($element, $tag, $namespace=self::SPEC) private function _child($element, $tag, $namespace=self::SPEC)