public function findActiveByAccountIdentifierAndAuthenticationProviderName($accountIdentifier, $authenticationProviderName)
    {
        $query = $this->createQuery();
        return $query->matching(
            $query->logicalAnd(
                $query->equals('accountIdentifier', $accountIdentifier),
                $query->equals('authenticationProviderName', $authenticationProviderName),
                $query->logicalOr(
                    $query->equals('expirationDate', null),
                    $query->greaterThan('expirationDate', new \DateTime())
                )
            )
        )->execute()->getFirst();
    }
public function findActiveByAccountIdentifierAndAuthenticationProviderName($accountIdentifier, $authenticationProviderName)
    {
        $query = $this->createQuery();
        return $query->matching(
            $query->logicalAnd(
                $query->equals('accountIdentifier', $accountIdentifier),
                $query->equals('authenticationProviderName', $authenticationProviderName),
                $query->logicalOr(
                    $query->equals('expirationDate', null),
                    $query->greaterThan('expirationDate', new \DateTime())
                )
            )
        )->execute()->getFirst();
    }
public function findActiveByAccountIdentifierAndAuthenticationProviderName ( $ accountIdentifier , $ authenticationProviderName ) { $ query = $ this -> createQuery ( ) ; return $ query -> matching ( $ query -> logicalAnd ( $ query -> equals ( 'accountIdentifier' , $ accountIdentifier ) , $ query -> equals ( 'authenticationProviderName' , $ authenticationProviderName ) , $ query -> logicalOr ( $ query -> equals ( 'expirationDate' , null ) , $ query -> greaterThan ( 'expirationDate' , new \ DateTime ( ) ) ) ) ) -> execute ( ) -> getFirst ( ) ; }
Returns the account for a specific authentication provider with the given identifier if it's not expired

@param string $accountIdentifier The account identifier
@param string $authenticationProviderName The authentication provider name
@return Account
Returns the account for a specific authentication provider with the given identifier if it s not expired