本文整理匯總了PHP中Parse\ParseUser::destroy方法的典型用法代碼示例。如果您正苦於以下問題:PHP ParseUser::destroy方法的具體用法?PHP ParseUser::destroy怎麽用?PHP ParseUser::destroy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Parse\ParseUser
的用法示例。
在下文中一共展示了ParseUser::destroy方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: dtestUserUpdates
public function dtestUserUpdates()
{
$user = new ParseUser();
$user->setUsername('asdf');
$user->setPassword('zxcv');
$user->set('email', 'asdf@example.com');
$user->signUp();
$this->assertNotNull(ParseUser::getCurrentUser());
$user->setUsername('test');
$user->save();
$this->assertNotNull($user->get('username'));
$this->assertNotNull($user->get('email'));
$user->destroy();
$query = ParseUser::query();
$this->setExpectedException('Parse\\ParseException', 'Object not found');
$fail = $query->get($user->getObjectId());
}
示例2: signUpUser
function signUpUser($email, $password, $token, $phone = "301-828-8684")
{
$user = new ParseUser();
$user->set("username", $email);
$user->set("password", $password);
$user->set("email", $email);
$user->set("phone", $phone);
// Parse try-catch
try {
$user->signUp();
// Stripe try-catch
try {
$customer = \Stripe\Customer::create(array('email' => $email, 'card' => $token));
$user->set("stripeID", $customer->id);
$user->save();
} catch (\Stripe\Error\InvalidRequest $e) {
$user->destroy();
return $e->getMessage();
} catch (\Stripe\Error\Authentication $e) {
$user->destroy();
return $e->getMessage();
} catch (\Stripe\Error\ApiConnection $e) {
$user->destroy();
return $e->getMessage();
} catch (\Stripe\Error\Base $e) {
$user->destroy();
return $e->getMessage();
} catch (Exception $e) {
$user->destroy();
return $e->getMessage();
}
} catch (\Parse\ParseException $ex) {
return $ex->getMessage();
}
return "success";
}