[TYPO3-dev] FlexForm with itemsProcFunc using ExtBase Repository

Christian Ludwig cl at viazenetti.de
Fri May 9 12:36:17 CEST 2014


Hi,

I have a FlexForm with a select field that gets its data by a user function (itemsProcFunc). The user function simply ceated a new repository and fetched the results from a REST service. This might not be elegant but did the job in TYPO3 v4.7.

$this->trainerRepository = new Tx_Myclass_Domain_Repository_TrainerRepository();
$list = $this->trainerRepository->findAll();


But now I am updating to TYPO3 v6.2 and the constructor needs a parameter of the type "\TYPO3\CMS\Extbase\Object\ObjectManagerInterface". So I changed my code to


$this->objectManager = TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager')
$this->trainerRepository = new Tx_Myclass_Domain_Repository_TrainerRepository();
$list = $this->trainerRepository->findAll($this->objectManager);

The question is, if there is a way to get things running with the annotation @inject?

/**
 * @var Tx_Myclass_Domain_Repository_TrainerRepository
 * @inject
 */
protected $trainerRepository;

This post is related to "How to get Plugin settings in ExtBase Repository in v6.2".

Thanks for any hints
Christian 


More information about the TYPO3-dev mailing list