diff --git a/lib/Productsup/Platform/Process.php b/lib/Productsup/Platform/Process.php index 5ed797e..ba920a2 100644 --- a/lib/Productsup/Platform/Process.php +++ b/lib/Productsup/Platform/Process.php @@ -14,6 +14,7 @@ class Process extends DataModel { * adds a reference to a site that can later be used as an identifier * note: this is only possible when creating a site or project * @param Reference $reference + * @throws ClientException When adding non site reference */ public function addReference(Reference $reference) { if ($reference->getKey() != Reference::REFERENCE_SITE) { @@ -26,13 +27,19 @@ public function addReference(Reference $reference) { /** * cast data to an array + * @param boolean $full * @return array */ - public function toArray() { - return array( + public function toArray($full = true) { + $data = array( 'id' => $this->action_id, 'action' => $this->action, - 'site_id' => $this->site_id, ); + + if ($full) { + $data['site_id'] = $this->site_id; + } + + return $data; } } diff --git a/lib/Productsup/Service/Process.php b/lib/Productsup/Service/Process.php index 297b8a7..438c4e2 100644 --- a/lib/Productsup/Service/Process.php +++ b/lib/Productsup/Service/Process.php @@ -45,7 +45,7 @@ public function post(ProcessModel $model) { $request = $this->getRequest(); $request->method = Request::METHOD_POST; - $request->postBody = $model->toArray(); + $request->postBody = $model->toArray(false); $request->url .= '/'.$model->site_id; $data = $this->executeRequest($request);