Browse Source

Add ArrayExpression support in related tables

tags/2.0.16
GHopper 6 years ago
parent
commit
a7771acd8d
  1. 1
      framework/CHANGELOG.md
  2. 2
      framework/db/ActiveRelationTrait.php

1
framework/CHANGELOG.md

@ -4,6 +4,7 @@ Yii Framework 2 Change Log
2.0.16 under development
------------------------
- Bug #16966: Fix ArrayExpression support in related tables (GHopperMSK)
- Bug #16028: Fix serialization of complex cache keys that contain non-UTF sequences (rugabarbo)
- Bug #16945: Fixed RBAC DbManager ruleName fetching on the case of PDO::ATTR_ORACLE_NULLS => PDO::NULL_TO_STRING (razonyang)
- Bug #16081: Fixed composite IN using just one column (rugabarbo)

2
framework/db/ActiveRelationTrait.php

@ -525,6 +525,8 @@ trait ActiveRelationTrait
if (($value = $model[$attribute]) !== null) {
if (is_array($value)) {
$values = array_merge($values, $value);
} elseif(($value instanceof ArrayExpression) && ($value->getDimension() === 1)) {
$values = array_merge($values, $value->getValue());
} else {
$values[] = $value;
}

Loading…
Cancel
Save