本文整理汇总了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";
}