Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions src/Rest/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ public function __construct(Session $session, array $fromData = null)
}
}

public function save($updateObject = false): void
/**
* @param bool $updateObject
* @return array|string|null
* @throws RestResourceRequestException
* @throws \JsonException
*/
public function save(bool $updateObject = false)
{
$data = self::dataDiff($this->toArray(true), $this->originalState);

Expand All @@ -71,11 +77,18 @@ public function save($updateObject = false): void

self::createInstance($body[$this->getJsonBodyName()], $this->session, $this);
}

return $response->getDecodedBody();
}

public function saveAndUpdate(): void
/**
* @return array|string|null
* @throws RestResourceRequestException
* @throws \JsonException
*/
public function saveAndUpdate()
{
$this->save(true);
return $this->save(true);
}

public function __get(string $name)
Expand Down