summaryrefslogtreecommitdiffstats
path: root/lib/SparkPost/Resource.php
diff options
context:
space:
mode:
authorVincent Song <vincentwsong@gmail.com>2016-06-10 11:25:50 -0400
committerVincent Song <vincentwsong@gmail.com>2016-06-10 11:25:50 -0400
commit3e2a3b21d11ca3a1b4d1564547ce0094596344eb (patch)
tree3430b00cb7ce92a2eb95971eb01fecd656004ee0 /lib/SparkPost/Resource.php
parentaac8412f0b6a12dd26b21e891a6f216e0a1c88e2 (diff)
downloadphp-sparkpost-3e2a3b21d11ca3a1b4d1564547ce0094596344eb.zip
php-sparkpost-3e2a3b21d11ca3a1b4d1564547ce0094596344eb.tar.gz
php-sparkpost-3e2a3b21d11ca3a1b4d1564547ce0094596344eb.tar.bz2
Updated Transmission.php for new refactor, still WIP. Created Resource.php as a parent class for all future resources.
Diffstat (limited to 'lib/SparkPost/Resource.php')
-rw-r--r--lib/SparkPost/Resource.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/SparkPost/Resource.php b/lib/SparkPost/Resource.php
new file mode 100644
index 0000000..2cc5aa7
--- /dev/null
+++ b/lib/SparkPost/Resource.php
@@ -0,0 +1,30 @@
+<?php
+
+namespace SparkPost;
+
+class Resource
+{
+ protected $sparkpost;
+ protected $endpoint;
+
+ public function __constructor(SparkPost $sparkpost, $endpoint)
+ {
+ $this->sparkpost = $sparkpost;
+ $this->endpoint = $endpoint;
+ }
+
+ public function get($uri, $payload)
+ {
+ return $this->sparkpost->request('GET', $this->endpoint.'/'.$uri, $payload);
+ }
+
+ public function post($payload)
+ {
+ echo $payload;
+ return $this->sparkpost->request('POST', $endpoint, $payload);
+ }
+
+ public function test(){
+ echo "TEST";
+ }
+}