protected function _getTable(Request $request, $table = null) { if (empty($table)) { return $this->_getTableFromRequest($request); } if ($table instanceof Table) { return $table; } return TableRegistry::get($table); }