Это единственный контроллер/таблица, который этого не делает
Контроллер
Код: Выделить всё
public function edit($id = null)
{
$company = $this->Companies->get($id, [
'contain' => [],
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$company = $this->Companies->patchEntity($company, $this->request->getData());
if ($this->Companies->save($company)) {
$this->Flash->success(__('The company has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The company could not be saved. Please, try again.'));
}
$users = $this->Companies->Users->find('list', ['limit' => 200]);
$this->set(compact('company', 'users'));
}
Код: Выделить всё
Подробнее здесь: [url]https://stackoverflow.com/questions/78680287/beforesave-is-not-firing-when-saving-entity[/url]
Мобильная версия