Skip to content

Commit

Permalink
Merge pull request #26 from pyranhax/master
Browse files Browse the repository at this point in the history
Added delete contact
  • Loading branch information
DivineOmega authored Nov 29, 2016
2 parents f98d20f + 4adf985 commit 945d89b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions factories/ContactFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,4 +282,15 @@ public static function create($name, $phoneNumber, $emailAddress)

return new Contact($contactDetails);
}

public static function delete(Contact $toDelete)
{
$client = GoogleHelper::getClient();

$req = new \Google_Http_Request($toDelete->editURL);
$req->setRequestHeaders(array('content-type' => 'application/atom+xml; charset=UTF-8; type=feed'));
$req->setRequestMethod('DELETE');

$client->getAuth()->authenticatedRequest($req);
}
}

0 comments on commit 945d89b

Please sign in to comment.