Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typo3 类型3创建前端用户_Typo3_Typo3 9.x - Fatal编程技术网

Typo3 类型3创建前端用户

Typo3 类型3创建前端用户,typo3,typo3-9.x,Typo3,Typo3 9.x,在我的服务课上我有 /** * @var \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository * @inject */ protected $frontendUserRepository; /** * @var \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager * @inject */ protected $persistenceManager;

在我的服务课上我有

/**
 * @var \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository
 * @inject
 */
protected $frontendUserRepository;

/**
 * @var \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager
 * @inject
 */
protected $persistenceManager;
在函数中:

$objectManager = GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager');
$this->frontendUserRepository = $objectManager->get('TYPO3\\CMS\\Extbase\\Domain\\Repository\\FrontendUserRepository');
$frontendUser = new FrontendUser();
$frontendUser->setUsername($bla);
$frontendUser->setPassword($bliep);
$this->frontendUserRepository->add($frontendUser);
$this->persistenceManager = $objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager');
$this->persistenceManager->persistAll();
然后我得到一个错误

表“dbname.tx\u extbase\u domain\u model\u frontenduser”不存在


如何将新用户存储在“fe_users”表中?

在打字稿设置extbase配置中创建表映射:

config.tx_extbase {
    persistence {
        classes {
            TYPO3\CMS\Extbase\Domain\Model\FrontendUser {
                mapping {
                    tableName = fe_users
                }
            }
        }
    }
}

在键入脚本设置extbase配置中创建表映射:

config.tx_extbase {
    persistence {
        classes {
            TYPO3\CMS\Extbase\Domain\Model\FrontendUser {
                mapping {
                    tableName = fe_users
                }
            }
        }
    }
}

这有用吗我看到类似于
config.tx\u extbase.persistence.classesTx\u Extname\u Domain\u Model\u Member.mapping.tableName=fe\u users
的东西,但我没有模型?Thx作为方向。我想我需要一个映射模型,所以我现在决定直接用Dbal insert查询插入新用户。您可以使用它。但是,我不确定,看起来您需要创建自己的模型(扩展FE用户模型),以便能够映射。这有帮助吗我看到类似于
config.tx\u extbase.persistence.classesTx\u Extname\u Domain\u Model\u Member.mapping.tableName=fe\u users
的东西,但我没有模型?Thx作为方向。我想我需要一个映射模型,所以我现在决定直接用Dbal insert查询插入新用户。您可以使用它。但是,我不确定,看起来您需要创建自己的模型(扩展FE用户模型),以便能够映射。我已经扩展了frontenduser,但在服务类中似乎忽略了映射。我想打字稿需要在那里加载。但是我想在尝试了一段时间后,我会使用教义。谢谢!我已经扩展了frontenduser,但是在服务类中似乎忽略了映射。我想打字稿需要在那里加载。但是我想在尝试了一段时间后,我会使用教义。谢谢!