如何仅在 CakePHP 3.0 中更新或保存特定字段?

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

我想在 Cakephp 3.0 中更新或保存 table 的特定字段。我尝试了 Cakebook 中的 Updating Data,它正在保存数据,但问题是它还保存了在数据库中指定为日期时间的 modified 字段。在那种情况下我不想保存这个字段。我该怎么做?

提前致谢

当您不想触发回调时,只需使用updateAll()

$table->updateAll(['field' => $newValue], ['id' => $entityId]);