- 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:
parent
538af38769
commit
5be0c8cc01
|
@ -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() );
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ class Where extends Fragment {
|
|||
}
|
||||
|
||||
return $this->renderSegments([
|
||||
! $this->parent ? static::SQL_TOKEN : "",
|
||||
! $this->parent && ! empty($this->conditionList) ? static::SQL_TOKEN : "",
|
||||
implode(" ", $stack)
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue