cakephp - cakephp:使用保存方法,我想在数据没有变化时更新修改时间
问题描述
请帮我解决这个问题,非常感谢。
第 1 部分:数据已更改,我使用 [ $this->abcModel->save($abc);
],abcTable's
修改后的列已更改。 ===>
那没问题。
Part2:数据没变,我也想abcTable's
修改的列变了,怎么处理?(如果给我一个例子,会更好理解。)
使用版本:cakephp 3.3
解决方案
Cakephp 版本:cakephp 3.3
$this->Model->touch($data);
[参考] https://book.cakephp.org/3.0/en/orm/behaviors/timestamp.html
推荐阅读
- scala - 无法使用 Kafka-Streams 反序列化自定义 Serde
- python - Turtle Filling Colors - 我在调用函数时尝试选择颜色,以便将来可以轻松更改
- scheme - 如何在 mit-scheme 中正确使用(读取)?
- visual-studio-extensions - 更改 TaggerProvider 的名称,代码无法工作
- swift - 那么如何从另一个函数而不是函数中的行更改单元格的文本?
- python - 使用 smtplib 发送邮件时 DKIM 失败
- css - React w Gatsby:为什么我的字体文件有时会下载两次
- ios - pattern.firstMatch 得到错误:表达式类型“@lvalue 字符串?” 没有更多上下文是模棱两可的
- javascript - 当我使用 ng build 进行部署时,如何解决 Angular 项目中 vendor.js 中的错误语法
- unity3d - 使用行进立方体算法(体素)实现多纹理着色