Skip to content

Commit 5b53fe8

Browse files
committed
Add the array value type
1 parent dc34b17 commit 5b53fe8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/JSONDB/JSONDB.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,7 @@ protected function _getTableContent($table = NULL)
677677
* @param $value
678678
* @param $properties
679679
* @return float|int|string
680+
* @throws Exception
680681
*/
681682
protected function _parseValue($value, $properties)
682683
{
@@ -697,7 +698,6 @@ protected function _parseValue($value, $properties)
697698
}
698699
break;
699700

700-
default:
701701
case 'string':
702702
$value = (string)$value;
703703
if (array_key_exists('max_length', $properties) && strlen($value) > 0) {
@@ -713,6 +713,13 @@ protected function _parseValue($value, $properties)
713713
case 'boolean':
714714
$value = (bool)$value;
715715
break;
716+
717+
case 'array':
718+
$value = (array)$value;
719+
break;
720+
721+
default:
722+
throw new Exception("JSONDB Error: Trying to parse a value with an unsupported type \"{$properties['type']}\"");
716723
}
717724
}
718725
}

0 commit comments

Comments
 (0)