Skip to content

Commit

Permalink
Minor fixes to Process Model
Browse files Browse the repository at this point in the history
  • Loading branch information
m038 committed Sep 13, 2017
1 parent 39f7bdc commit 52fd0a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions lib/Productsup/Platform/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
}
}
2 changes: 1 addition & 1 deletion lib/Productsup/Service/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 52fd0a5

Please sign in to comment.