Fixed a getting value from config through method toArray

This commit is contained in:
Vasily Komrakov 2016-02-14 02:54:47 +03:00
commit dff1484214

View file

@ -69,4 +69,24 @@ class Config extends ZendConfig
return $value;
}
/**
* @inheritdoc
*/
public function toArray()
{
$array = [];
$data = $this->data;
/** @var self $value */
foreach ($data as $key => $value) {
if ($value instanceof self) {
$array[$key] = $value->toArray();
} else {
$array[$key] = $this->prepareValue($value);
}
}
return $array;
}
}