public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$table = $this->loadModel();
$tableAlias = $table->alias();
$entity = $table->get($id, ['contain' => []]);
$singular = Inflector::singularize(Inflector::humanize($tableAlias));
if ($table->delete($entity)) {
$this->Flash->success(__d('CakeDC/Users', 'The {0} has been deleted', $singular));
} else {
$this->Flash->error(__d('CakeDC/Users', 'The {0} could not be deleted', $singular));
}
return $this->redirect(['action' => 'index']);
}