Suppose that you construct an object, e.g.
<?php
$string = new \Sandbox\Model\String($this->db);
$string['name'] = 'foo';
$string->save(); // INSERTs object to the database and triggers "afterInsert" method
$string['name'] = 'bar';
$string->save(); // UPDATEs object's instance in the database and triggers "afterUpdate" method
$string->save(); // Does not not execute MySQL query because object state has not changed.
Should the 3rd call to save:
- Issue MySQL query? (even though it is assumed that it will not affect the record)
- If query is not executed, should the
afterUpdate method be triggered?
Suppose that you construct an object, e.g.
Should the 3rd call to
save:afterUpdatemethod be triggered?