0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CakePHP :save メソッド1_modifiedカラムの内容が変更する対応

Posted at

saveでデータを保存するとき、modifiedカラム変更の対応:

  • データ内容が変わる場合、更新・新規ができるし、modifiedカラムの内容が変更できる:

$this->ModelName->save($data);

  • データ内容が変わらずの場合、modifiedカラムだけ更新したい場合:

$this->ModelName->touch($data); // 追加して

$this->ModelName->save($data);

以上です。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?