Mikael
Mikael

Reputation: 1309

TYPO3 userRepository return NULL

I have TYPO3 version 7.6.18.

In controller of my extension I have

/**
 * @var \Fhk\Feusersplus\Domain\Repository\UserRepository
 * @inject
 */
protected $userRepository;

In action I try

var_dump($this->userRepository);

And problem is that it return non object, NULL! Why ?? I have cleaned all caches, delete rows from cf_extbase_reflection and delete typo3temp.

In my other extensions it working! Do you have any ideas ? Help me please )

Upvotes: 2

Views: 712

Answers (1)

Christoph
Christoph

Reputation: 74

You can create the repository object manually (you need the objectManager from your abstractAction or you have to create the objectManager also):

$this->userRepository = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Domain\\Repository\\FrontendUserRepository');

Upvotes: 2

Related Questions