Skip to content

Commit 66444b6

Browse files
committed
Add support for options when calling Storable::{save,insert,update,delete}
1 parent d4de806 commit 66444b6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/Picqer/Carriers/SendCloud/Persistance/Storable.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,29 @@
1313
*/
1414
trait Storable
1515
{
16-
public function save()
16+
public function save($options = [])
1717
{
1818
if ($this->exists()) {
19-
$this->fill($this->update());
19+
$this->fill($this->update($options));
2020
} else {
21-
$this->fill($this->insert());
21+
$this->fill($this->insert($options));
2222
}
2323

2424
return $this;
2525
}
2626

27-
public function insert()
27+
public function insert(array $options = [])
2828
{
29-
return $this->connection()->post($this->url, $this->json());
29+
return $this->connection()->post($this->url, $this->json(), $options);
3030
}
3131

32-
public function update()
32+
public function update(array $options = [])
3333
{
34-
return $this->connection()->put($this->url . '/' . urlencode($this->id), $this->json());
34+
return $this->connection()->put($this->url . '/' . urlencode($this->id), $this->json(), $options);
3535
}
3636

37-
public function delete()
37+
public function delete(array $options = [])
3838
{
39-
return $this->connection()->delete($this->url . '/' . urlencode($this->id));
39+
return $this->connection()->delete($this->url . '/' . urlencode($this->id), $options);
4040
}
41-
}
41+
}

0 commit comments

Comments
 (0)