Implement Document::toArray()

refs #10150
This commit is contained in:
Alexander A. Klimov 2015-09-22 14:13:10 +02:00
parent 777c4d0baf
commit acb93ce1ae
1 changed files with 14 additions and 0 deletions

View File

@ -115,4 +115,18 @@ class Document
}
return $str;
}
/**
* Convert $this to an array
*
* @return array
*/
public function toArray()
{
$a = array();
foreach ($this->sections as $section) {
$a[$section->getName()] = $section->toArray();
}
return $a;
}
}