- Array type can now be assign directly (not as json or serialized)\n- Fixed a bug within WHERE when open() and close() where called without a condition

This commit is contained in:
mcndave committed 2020-10-06 17:46:34 +00:00
1 parent 538af38769
commit 5be0c8cc01
2 files changed
+8 -3

No files matched your search

+7 -2
View File
@@ -207,10 +207,15 @@ trait EntityTrait {
$this->{$field['name']} = null;
}
elseif ( $field['type'] === 'array' ) {
$this->{$field['name']} = substr($value, 0, 1) === "a" ? unserialize($value) : json_decode($value, true);
if ( is_string($value)) {
$this->{$field['name']} = substr($value, 0, 1) === "a" ? unserialize($value) : json_decode($value, true);
}
elseif ( is_array($value) ) {
$this->{$field['name']} = $value;
}
}
elseif ( EntityField::isScalarType($field['type']) ) {
if ( $field['type'] === 'string' ) {
$annotation = $entityResolver->searchFieldAnnotation($field['name'], new Field() );