diff --git a/src/Bounce.php b/src/Bounce.php new file mode 100644 index 0000000..d45541a --- /dev/null +++ b/src/Bounce.php @@ -0,0 +1,18 @@ +basePath, '/') . '/' . rtrim($id, '/') . '/' . 'bounces/?paginate_by=100'; + } + + public function constructEntity($data) + { + $array = []; + foreach ($data->body['results'] as $result) + { + $entity = new $this->entityClass(); + foreach (array_keys(get_object_vars($entity)) as $property) { + if (property_exists($result, $property)) { + $entity->$property = $result->$property; + } + } + array_push($array, $entity); + } + return $array; +} diff --git a/src/Link.php b/src/Link.php new file mode 100644 index 0000000..fc98025 --- /dev/null +++ b/src/Link.php @@ -0,0 +1,17 @@ +basePath, '/') . '/' . rtrim($id, '/') . '/' . 'links/?paginate_by=100'; + } + + public function constructEntity($data) + { + $array = []; + foreach ($data->body['results'] as $result) + { + $entity = new $this->entityClass(); + foreach (array_keys(get_object_vars($entity)) as $property) { + if (property_exists($result, $property)) { + $entity->$property = $result->$property; + } + } + array_push($array, $entity); + } + return $array; +} diff --git a/src/Open.php b/src/Open.php new file mode 100644 index 0000000..1dde90d --- /dev/null +++ b/src/Open.php @@ -0,0 +1,16 @@ +basePath, '/') . '/' . rtrim($id, '/') . '/' . 'opens/?paginate_by=100'; + } + + public function constructEntity($data) + { + $array = []; + foreach ($data->body['results'] as $result) + { + $entity = new $this->entityClass(); + foreach (array_keys(get_object_vars($entity)) as $property) { + if (property_exists($result, $property)) { + $entity->$property = $result->$property; + } + } + array_push($array, $entity); + } + return $array; +} diff --git a/src/Report.php b/src/Report.php new file mode 100644 index 0000000..fe2eaf9 --- /dev/null +++ b/src/Report.php @@ -0,0 +1,31 @@ +basePath, '/') . '/' . rtrim($id, '/') . '/' . 'unsubscribed/?paginate_by=100'; + } + + public function constructEntity($data) + { + $array = []; + foreach ($data->body['results'] as $result) + { + $entity = new $this->entityClass(); + foreach (array_keys(get_object_vars($entity)) as $property) { + if (property_exists($result, $property)) { + $entity->$property = $result->$property; + } + } + array_push($array, $entity); + } + return $array; +}