我正在尝试使用CakePHP 3.2编写RESTful服务,请遵循本指南http://book.cakephp.org/3.0/en/development/rest.html
除了edit()之外,每个函数都可以正常工作,当我在Postman中使用PUT方法进行测试时,它已经返回" Saved"但是在Mysql数据库中没有任何改变
我不确定它是关于Code,MySql还是Server Configuration?
public function edit($id){
$appointmentType = $this->AppointmentType->get($id);
if ($this->request->is(['post', 'put'])) {
$appointmentType = $this->AppointmentType->patchEntity($appointmentType, $this->request->data);
if ($this->AppointmentType->save($appointmentType)) {
$message = 'Saved';
} else {
$message = 'Error';
}
}
$this->set([
'message' => $message,
'_serialize' => ['message']
]);
}