2020-10-14から1日間の記事一覧

【CakePHP3】patchEntityの使い方

よくあるpatchEntityの使い方の例は、 $post = $this->Posts->get(1); $this->Posts->patchEntity($post, $this->request->getData()); $this->Posts->save($post); こんな感じで、対象のデータを変数に格納して、そのデータにフォームから送られてきたデー…