[TYPO3-mvc] T3 6.1 Injection of Repository mapped to FE_User not working

g4-lisz at tonarchiv.ch g4-lisz at tonarchiv.ch
Tue Dec 17 23:28:05 CET 2013


Hi there

I have a class PortalUser derived from FrontendUser:

class PortalUser extends \TYPO3\CMS\Extbase\Domain\Model\FrontendUser { ...}

I also did the mapping in ext_typoscritp_setup.txt:

            TYPO3\CMS\Extbase\Domain\Model\FrontendUser {
                subclasses {
                    Tx_Stdapp_PortalUser = GK\Stdapp\Domain\Model\PortalUser
                   
                  }
            }
            GK\Stdapp\Domain\Model\PortalUser {
                mapping {
                    tableName = fe_users
                    recordType = Tx_Stdapp_PortalUser
                }
            }

Using the PortalUser works fine. But injection the PortalUserRespository
does not work:

        /*
         * portalUserRepository
         *
         * @var \GK\Stdapp\Domain\Repository\PortalUserRepository
         * @inject
         */
        protected $portalUserRepository;

When i call $this->portalUserRepository->findOneByCustomer($customer);
i get the error "Call to a member function findOneByCustomer() on a
non-object in XXX"
I.e. portalUserRepository is not injected.

What I am doing wrong?

\GK\Stdapp\Domain\Repository\PortalUserRepository exists and is derived
from \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository
I also tried \TYPO3\CMS\Extbase\Persistence\Repository, but still the same.

Regards,
Till


More information about the TYPO3-project-typo3v4mvc mailing list