1

我需要访问这个特殊用户存储库中的容器。我不确定如何在不绊倒 UserProviderInterface 的情况下做到这一点。谢谢你的帮助!

class UserRepository extends EntityRepository implements UserProviderInterface
{

    public function loadUserByUsername($username)
    {
        //the container provide the $tenantID, which I need for my query

        $q = $this
            ->createQueryBuilder('u')
            ->where('u.tenantid = :tenantid AND u.email = :email')
            ->setParameter('tenantid', $tenantId)
            ->setParameter('email', $username)
            ->getQuery();

        try {......

        return $user;
    }
4

0 回答 0