/** * Delete method * * @param string|null $id id. * @return \Cake\Network\Response|null Redirects to index. * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found. */ public function delete($id = null) { $this->request->allowMethod(['post', 'delete']); $ = $this->->get($id); if ($this->->delete($)) { $this->Flash->success(__('The has been deleted.')); } else { $this->Flash->error(__('The could not be deleted. Please, try again.')); } return $this->redirect(['action' => 'index']); }