Closed wenbert closed 10 years ago
CakePHP3
Using the Edit mysite.com/products/edit/123 generated from Console/cake bake - the modified field gets updated.
mysite.com/products/edit/123
Console/cake bake
modified
But doing this manually from another controller - the modified field is not updated.
$updateQuery = $this->Products->query(); $result = $updateQuery->update() ->set($productData) ->where(['id' => $productRow->id]) ->execute();
The other fields are updated from the $productData array. $productData['modified'] is not set.
$productData
$productData['modified']
Modified field is: `modified datetime NOT NULL`
`modified
Creating raw queries will not rigger any of the automatic callbacks in the Table, including the modified column saving. If you need such feature, please uses save instead.
save
CakePHP3
Using the Edit
mysite.com/products/edit/123
generated fromConsole/cake bake
- themodified
field gets updated.But doing this manually from another controller - the modified field is not updated.
The other fields are updated from the
$productData
array.$productData['modified']
is not set.Modified field is:
`modified
datetime NOT NULL`