Skip to content

Commit

Permalink
Implement Section::toArray()
Browse files Browse the repository at this point in the history
refs #10150
  • Loading branch information
Al2Klimov committed Sep 22, 2015
1 parent b441156 commit 777c4d0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions library/Icinga/File/Ini/Dom/Section.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,18 @@ protected function sanitize($str)
$str = str_replace(';', '\\;', $str);
return str_replace(PHP_EOL, ' ', $str);
}

/**
* Convert $this to an array
*
* @return array
*/
public function toArray()
{
$a = array();
foreach ($this->directives as $directive) {
$a[$directive->getKey()] = $directive->getValue();
}
return $a;
}
}

0 comments on commit 777c4d0

Please sign in to comment.