[TYPO3-mvc] [TYPO3 6.1beta1] Using a repository in a service...
Stig Nørgaard Færch
snf at dkm.dk
Thu Dec 5 16:28:21 CET 2013
Hello,
I'm trying to use a repository in a service by declaring this:
/**
* frontendUserRepository
*
* @var \TYPO3\Dkmbydel\Domain\Repository\FrontendUserRepository
*/
protected $frontendUserRepository;
also tried with
\TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository
But no matter what there is no object in $this->frontendUserRepository
to work on.
I then tried to instantiate the object manually by:
$user =
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\Dkmbydel\Domain\Repository\FrontendUserRepository');
But this fails with this error:
#1: PHP Catchable Fatal Error: Argument 1 passed to
TYPO3\CMS\Extbase\Persistence\Repository::__construct() must implement
interface TYPO3\CMS\Extbase\Object\ObjectManagerInterface, none given,
called in
......./htdocs/typo3_src-6.2.0beta1/typo3/sysext/core/Classes/Utility/GeneralUtility.php
on line 4149 and defined in
......./htdocs/typo3_src-6.2.0beta1/typo3/sysext/extbase/Classes/Persistence/Repository.php
line 89 (More information)
Is this a bug?
Or am forgetting to do something?
Btw. Extbase rocks! :-)
Best regards,
Stig
More information about the TYPO3-project-typo3v4mvc
mailing list