0

Because of using ajax i have a eID configured, see below: I would like to use a existing repository of my extension. So i'm loading a Controller via ext_localconf.php which works, i'm in the TestController:

$TYPO3_CONF_VARS['FE']['eID_include']['ajaxDispatcher'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('exacallmanagement').'Classes/Controller/TestController.php';

In TestController i run:

\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('VENDOR\Exacallmanagement\Classes\Domain\Repository\CallhistoryRepository');

Namespace should be correct, and i always get a: Fatal error: Class '\VENDOR\Exacallmanagement\Classes\Domain\Repository\CallhistoryRepository' not found in /Users/jacques/Sites/_typo3_engines/6.1.6/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 4114

Any hint?

metaxos
  • 151
  • 1
  • 16

1 Answers1

1

You should not use makeInstance to create an instance of a repository. You should first get an instance of the ObjectManager and then use it to get the repository:

    $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('\TYPO3\CMS\Extbase\Object\ObjectManager');
    $sampleRepository= $objectManager->get('\My\Extension\Domain\Repository\SampleRepository');
lorenz
  • 4,538
  • 1
  • 27
  • 45