我有一个包含 2 个应用程序的存储库。第一个应用程序已经启动并运行,并且具有身份验证和所需的逻辑。第二个应用程序是我用 2FA 支持扩展第一个应用程序。第二个应用程序应该处理与 2FA 相关的所有事情(发送 SMS、确认、将电话号码保存到数据库等)我现在想将我的 ExtendedUser 模型保存到具有相应存储库的数据库中,但我不知道如何获取第一个应用程序的当前经过身份验证的用户,并在我可以保存模型的第二个应用程序中访问它。
由于对框架缺乏了解,我没有尝试过任何东西,很难理解它的要点..
<?php
namespace One50\TwoFactorAuth\Domain\Model;
/*
* This file is part of the One50.TwoFactorAuth package.
*/
use Neos\Flow\Annotations as Flow;
use Doctrine\ORM\Mapping as ORM;
use One50\Shop\Domain\Model\User;
/**
* @Flow\Entity
*/
class ExtendedUser
{
/**
* @var string
*/
protected $telephoneNumber;
/**
* @ORM\OneToOne
* @var User
*/
protected $user;
/**
* @return string
*/
public function getTelephoneNumber()
{
return $this->telephoneNumber;
}
/**
* @param string $telephoneNumber
* @return void
*/
public function setTelephoneNumber($telephoneNumber)
{
$this->telephoneNumber = $telephoneNumber;
}
}