CakeDC\Users\Model\Behavior\SocialAccountBehavior::resendValidation PHP Method

resendValidation() public method

Validates the social account
public resendValidation ( string $provider, string $reference ) : User
$provider string provider
$reference string reference
return CakeDC\Users\Model\Entity\User
    public function resendValidation($provider, $reference)
    {
        $socialAccount = $this->_table->find()->where(['provider' => $provider, 'reference' => $reference])->contain('Users')->first();
        if (!empty($socialAccount)) {
            if ($socialAccount->active) {
                throw new AccountAlreadyActiveException(__d('CakeDC/Users', "Account already validated"));
            }
        } else {
            throw new RecordNotFoundException(__d('CakeDC/Users', "Account not found for the given token and email."));
        }
        return $this->sendSocialValidationEmail($socialAccount, $socialAccount->user);
    }