Skip to content

Commit

Permalink
Implement Document::toArray()
Browse files Browse the repository at this point in the history
refs #10150
  • Loading branch information
Al2Klimov committed Sep 22, 2015
1 parent 777c4d0 commit acb93ce
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions library/Icinga/File/Ini/Dom/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,18 @@ public function render()
}
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;
}
}

0 comments on commit acb93ce

Please sign in to comment.