Extbase querySettings

$query->getQuerySettings()->setRespectStoragePage(false);
$query->getQuerySettings()->setRespectSysLanguage(false);
$query->getQuerySettings()->setIgnoreEnableFields(true);

Signals, Slots mit Powermail

ext_localconf.php

$methodName = 'savePowermailData';
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\SignalSlot\Dispatcher')->connect(
        'In2code\Powermail\Controller\FormController',
        'createActionAfterMailDbSaved',
        'Vendor\ExtensionName\Domain\Slot',
        $methodName
);

Vendor\ExtensionName\Domain\Slot.php

class Slot  
{
    public function savePowermailData(\In2code\Powermail\Domain\Model\Mail $mail)
    {
    }
}

debug Function

	private function debug($mixedValue){
                  DebuggerUtility::var_dump($mixedValue);
	        \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($mixedValue);
	}
	private function debugLog($mixedValue){
	        unlink("logger.log");
			error_log(print_r($mixedArray,true), 3, "logger.log");
	}

    /**
     * @param \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $queryResult
     * @param boolean $explainOutput
     * @return void
     */
    public function debugQuery(\TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $queryResult, $explainOutput = FALSE){
        $GLOBALS['TYPO3_DB']->debugOutput = 2;
        if($explainOutput){
            $GLOBALS['TYPO3_DB']->explainOutput = true;
        }
        $GLOBALS['TYPO3_DB']->store_lastBuiltQuery = true;
        $queryResult->toArray();
        \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($GLOBALS['TYPO3_DB']->debug_lastBuiltQuery);
        $GLOBALS['TYPO3_DB']->store_lastBuiltQuery = false;
        $GLOBALS['TYPO3_DB']->explainOutput = false;
        $GLOBALS['TYPO3_DB']->debugOutput = false;
    }

Enable debug info
config.contentObjectExceptionHandler = 0

GET templateRootPath

$templateRootPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($config['view']['templateRootPath']);

sample.xml To $xmlArray

$xmlContent = file_get_contents($this->getTemplateRootPath().'sample.xml');
$xmlArray = GeneralUtility::xml2array($xmlContent);

FrontendConfigurationManager

Extern: Config überall aufrufen

$cManager = $this->objectManager->get('TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager');
$extensionConfig = $cManager->getConfiguration($extensionName, NULL);

Intern: In der Extension aufrufen

$config = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);

StorageRepository & Move File

StorageRepository

$storageRepository = $this->objectManager->get('TYPO3\CMS\Core\Resource\StorageRepository');
// storage 1 == fileadmin
$storage = $storageRepository->findByUid('1');
$subFolder = $storage->createFolder('subFolder');
$tempFile = 'typo3temp/filePathTemp.jpg';
$moveFile = $storage->addFile($tempFile,$subFolder,'newFile.jpg');

Move File

$fileReference = $this->objectManager->get('TYPO3\CMS\Extbase\Domain\Model\FileReference');
$fileReference->setFile($moveFile);

Add File To News

 $news->addFalMedia($fileReference);