public function addArray($key, array $array = null)
{
if (isset($array)) {
foreach ($array as $index => $value) {
if ($value instanceof JsonConvertible) {
$this->json[$key][$index] = $value->getJsonObject();
} else {
$this->json[$key][$index] = $value;
}
}
}
return $this;
}