How to update or save a specific field only in CakePHP 3.0?

前端 未结 1 1826
执念已碎
执念已碎 2021-01-20 23:57

I want to update or save a specific field of a table in Cakephp 3.0. I tried Updating Data from the Cakebook and it is saving the data but problem is that it is also saving the

相关标签:
1条回答
  • 2021-01-21 00:41

    When you don't want callbacks to be triggered, just use updateAll()

    $table->updateAll(['field' => $newValue], ['id' => $entityId]);
    
    0 讨论(0)
提交回复
热议问题