public function confirm($newEmail)
    {
        // update status
        $this->status = static::STATUS_ACTIVE;

        // process $newEmail from a userToken
        //   check if another user already has that email
        $success = true;
        if ($newEmail) {
            $checkUser = static::findOne(["email" => $newEmail]);
            if ($checkUser) {
                $success = false;
            } else {
                $this->email = $newEmail;
            }
        }

        $this->save(false, ["email", "status"]);
        return $success;
    }
public function confirm($newEmail)
    {
        // update status
        $this->status = static::STATUS_ACTIVE;

        // process $newEmail from a userToken
        //   check if another user already has that email
        $success = true;
        if ($newEmail) {
            $checkUser = static::findOne(["email" => $newEmail]);
            if ($checkUser) {
                $success = false;
            } else {
                $this->email = $newEmail;
            }
        }

        $this->save(false, ["email", "status"]);
        return $success;
    }
public function confirm ( $ newEmail ) { // update status $ this -> status = static :: STATUS_ACTIVE ; // process $newEmail from a userToken //   check if another user already has that email $ success = true ; if ( $ newEmail ) { $ checkUser = static :: findOne ( [ "email" => $ newEmail ] ) ; if ( $ checkUser ) { $ success = false ; } else { $ this -> email = $ newEmail ; } } $ this -> save ( false , [ "email" , "status" ] ) ; return $ success ; }
Confirm user email
@param string $newEmail
@return bool
Confirm user email