1
0
Fork 0
mirror of synced 2024-10-02 10:16:27 +13:00

Updated response check

This commit is contained in:
Eldad Fux 2020-09-06 08:50:07 +03:00
parent 26ef7a83f0
commit c11116d764

View file

@ -209,11 +209,11 @@ class Response extends SwooleResponse
}
foreach ($data[$key] as &$item) {
if(!array_key_exists($rule['type'], $this->models)) {
throw new Exception('Missing model for rule: '. $rule['type']);
}
if($item instanceof Document) {
if(!array_key_exists($rule['type'], $this->models)) {
throw new Exception('Missing model for rule: '. $rule['type']);
}
$item = $this->output($item, $rule['type']);
}
}