/** * confirms a pending primary phone * @param code for confirmation */ public function confirmPhone($code) { if (isset($this->email)) { try { REST::confirmPhone($this->email, $code); return true; } catch (InvalidConfirmationCode $e) { return false; } catch (PhoneAlreadyConfirmed $e) { return true; // if they are already confirmed, but are confirming again... let them. } // end catch } else { Error::handle('Cannot confirm phone, object not properly initialized'); } // end else }