update all cakephp

Solutions on MaxInterview for update all cakephp by the best coders in the world

showing results for - "update all cakephp"
Luca
08 Aug 2017
1$update = $this->updateAll(
2  	array(value need to update),
3	array(conditions)
4);
5
6Ex:
7$update = $this->updateAll(
8  array(
9    'MemberLoginMethod.token' => NULL,
10  ),
11  array(
12    'MemberLoginMethod.member_id' => $member_id
13  )
14);
15
16
17// note: remmeber add " with string and date
18  $this->MembersPush->updateAll(array(
19    'MembersPush.pushed' => "\"" . $date . "\"",    // update with "" s
20  ), array(
21    'MembersPush.device_token' => $device,  // conditions
22    'MembersPush.push_history_id' => $push_history_id,
23    'MembersPush.type' => $type,
24  ));