$currentVersion = \TYPO3\CMS\Backend\Utility\BackendUtility::getWorkspaceVersionOfRecord('tx_myextension_mytable', $uid);
$versionInWorkspace = \TYPO3\CMS\Backend\Utility\BackendUtility::getWorkspaceVersionOfRecord('tx_myextension_mytable', $uid, $workspaceId);In this example, we are retrieving the version of the record with the given $uid in a specific workspace (identified by $workspaceId) for the table tx_myextension_mytable. Package Library: The \TYPO3\CMS\Backend\Utility\BackendUtility class is part of the core TYPO3 CMS package, so no additional package libraries are required to use it.