是否有更有效的方法通过id删除多个实体
$data = $this->request->data ['missing_lexicon_id']; foreach ( $data as $id ) { $missingLexicon = $this->MissingLexicons->get ( $id ); $this->MissingLexicons->delete ( $missingLexicon ) }
这应该工作
原文链接:https://www.f2er.com/php/133959.html$this->MissingLexicons->deleteAll(['MissingLexicons.column IN' => $keys]);
其中$keys是一个包含要删除的ID的数组.