Before doing new stuff, i want my scheduler-Task to remove all entries from the database, the execute-function looks like that:
public function execute() {
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager');
$jobRepository = $objectManager->get('\TYPO3\MyExtension\Domain\Repository\JobRepository');
//clear DB
$jobRepository->removeAll();
(...)//insert new entries to DB
$objectManager->get('TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface')->persistAll();
return true;
}
inserting new entries to the DB works fine, but clearing the DB doesn't work at all. What am I doing wrong?