From 3de4a1732d14e8303a836a0a86a44e280e9cbee2 Mon Sep 17 00:00:00 2001 From: Ivaylo Stoyanov Date: Sun, 22 May 2016 15:42:15 +0300 Subject: [PATCH] Add Pushbullet::push($iden) method --- src/Pushbullet/Pushbullet.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Pushbullet/Pushbullet.php b/src/Pushbullet/Pushbullet.php index dd559c2..5f10aed 100644 --- a/src/Pushbullet/Pushbullet.php +++ b/src/Pushbullet/Pushbullet.php @@ -60,6 +60,22 @@ public function getPushes($modifiedAfter = 0, $cursor = null, $limit = null) return $objPushes; } + /** + * Returns a Push object with the specified iden. + * + * @param string $iden Iden of push notification. + * @return Push Push notification object. + * + * @throws Exceptions\ConnectionException + * @throws Exceptions\NotFoundException If there's no push notification with the specified iden + */ + public function push($iden) + { + $response = Connection::sendCurlRequest(Connection::URL_PUSHES . '/' . $iden, 'GET', null, false, $this->apiKey); + + return new Push($response, $this->apiKey); + } + /** * Get a list of available devices. *