Fixed ExprBuilder to really use the parameter when replacing a key with an attribute
This commit is contained in:
parent
fa32adb9a3
commit
1305728502
@ -101,11 +101,11 @@ class ExprBuilder
|
|||||||
*/
|
*/
|
||||||
public function thenReplaceKeyWithAttribute($attribute)
|
public function thenReplaceKeyWithAttribute($attribute)
|
||||||
{
|
{
|
||||||
$this->thenPart = function($v) {
|
$this->thenPart = function($v) use ($attribute) {
|
||||||
$newValue = array();
|
$newValue = array();
|
||||||
foreach ($v as $k => $oldValue) {
|
foreach ($v as $k => $oldValue) {
|
||||||
if (is_array($oldValue) && isset($oldValue['id'])) {
|
if (is_array($oldValue) && isset($oldValue[$attribute])) {
|
||||||
$k = $oldValue['id'];
|
$k = $oldValue[$attribute];
|
||||||
}
|
}
|
||||||
|
|
||||||
$newValue[$k] = $oldValue;
|
$newValue[$k] = $oldValue;
|
||||||
|
Reference in New Issue
Block a user