ouzo icon indicating copy to clipboard operation
ouzo copied to clipboard

[ORM] Update should not update columns which did not changed

Open bbankowski opened this issue 10 years ago • 4 comments

e.g.

$product = Products::findById(1);
$product->name = 'test';
$product->update();

Should update name column only. Right now it will update everything.

bbankowski avatar Jan 12 '15 15:01 bbankowski

Important:

  • before and after callback are invoked regardless of update (e.g. if update is not invoked because nothing changed, callbacks are still invoked) - needs to be added as note to docs

More tests would be nice, especially with updateAttributes.

bbankowski avatar Jan 12 '15 16:01 bbankowski

Why do we need _trackUpdates?

woru avatar Jan 12 '15 16:01 woru

Removed.

bbankowski avatar Jan 13 '15 09:01 bbankowski

unsuccessful insert resets _updatedAttributes update does not reset _updatedAttributes probably unsuccessful update should not reset _updatedAttributes Why do we reset _updatedAttributes in Model::newInstance?

woru avatar Oct 18 '15 11:10 woru