E.g. with the core BackendUtility class. See example in powermail https://forge.typo3.org/projects/extension-powermail/repository/revisions/master/entry/Classes/Utility/BackendUtility.php#L75 -- TYPO3 separates the men from the boys :D TYPO3-Training from in2code.de