Skip to content

Commit

Permalink
Update CamundaModel.php
Browse files Browse the repository at this point in the history
  • Loading branch information
wertmenschen authored Sep 12, 2018
1 parent b375458 commit 975ae92
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Models/CamundaModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ abstract class CamundaModel
{
protected $client;
public $id;
public $key;

public function __construct($id = null, $attributes = [])
{
Expand Down Expand Up @@ -69,6 +70,16 @@ private function buildUrl($url)

private function modelUri()
{
return kebab_case(class_basename($this)) . '/' . $this->id;
if($this->key) {
return kebab_case(class_basename($this)) . '/key/' . $this->key . $this->tenant();
}
else {
return kebab_case(class_basename($this)) . '/' . $this->id;
}
}

protected function tenant()
{
return strlen(config('camunda.api.tenant-id')) ? '/tenant-id/' . config('camunda.api.tenant-id') : '';
}
}

0 comments on commit 975ae92

Please sign in to comment.