You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not work save to db from model, that was created from this type on select from db.
$newModel = Product::findOne($model->id);
$newModel->price; // is new Money(['value' => 10, 'currency_code' => 'USD'])
$newModel->price->value = 20;
$model->save(); - not work. In db still value = 10.
Not work save to db from model, that was created from this type on select from db.
$newModel = Product::findOne($model->id);
$newModel->price; // is new Money(['value' => 10, 'currency_code' => 'USD'])
$newModel->price->value = 20;
$model->save(); - not work. In db still value = 10.
But your exemple with new model works fine:
$newModel = Product::findOne($model->id);
$model->price = new Money([
'value' => 10,
'currency_code' => 'USD'
]);
$model->save();
The text was updated successfully, but these errors were encountered: