getRouter()->getRoute($routeIdentifier)?->getOption('module')?->getIdentifier() ?? ''); } /** * @return array{table?: string, recordid?: string, action?: string} */ private function parseRecordEditData(string $routeIdentifier, array $arguments): array { if ($routeIdentifier !== 'record_edit' || !is_array($arguments['edit'] ?? null)) { return []; } $table = key($arguments['edit']); $tableData = current($arguments['edit']); $recordId = is_array($tableData) ? key($tableData) : null; if (!is_string($table) || (!is_string($recordId) && !is_int($recordId))) { return []; } $recordId = (string)$recordId; if (str_ends_with($recordId, ',')) { $recordId = substr($recordId, 0, -1); } return [ 'table' => $table, 'recordid' => $recordId, 'action' => $arguments['edit'][$table][$recordId] ?? '', ]; } }