I have an array where i have id and status that need to update.
same thing i did in cakePHP 2.x easily using this code
$data = [
['id' => 1, 'status' =>1],
['id' => 2, 'status' => 2],
['id' => 3, 'status' => 2],
['id' => 4, 'status' => 1],
['id' => 5, 'status' => 2],
];
/* ID is primary id so it will update record */
$this->Comment->saveAll($data);
But in cakePHP 4.x I am facing issue.
I am trying this code
$data = [
['id' => 1, 'status' =>1],
['id' => 2, 'status' => 2],
['id' => 3, 'status' => 2],
['id' => 4, 'status' => 1],
['id' => 5, 'status' => 2],
];
$ent = $this->Applications->patchEntities($data);
$res = $this->Applications->saveMany($ent);
here getting this error message
Too few arguments to function Cake\ORM\Table::patchEntities(), 1 passed in /Applications/MAMP/htdocs/cake/my_app/src/Controller/CronsController.php on line 170 and at least 2 expected
Thanks