Skip to content

Commit

Permalink
Merge pull request #137 from renderforest/add-unique-sound-feature
Browse files Browse the repository at this point in the history
ProjectData: add insertUniqueSound method.
  • Loading branch information
narekhovhannisyan authored Dec 4, 2019
2 parents f55dbe8 + 449fd1b commit 61791ff
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "renderforest/sdk-php",
"description": "Renderforest SDK for PHP",
"version": "0.4.3",
"version": "0.4.4",
"homepage": "https://github.com/renderforest/renderforest-sdk-php",
"authors": [
{
Expand Down
14 changes: 13 additions & 1 deletion src/ProjectData/ProjectData.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Renderforest\ProjectData\Screen\Collection\ScreenCollection;
use Renderforest\ProjectData\Screen\Entity\Screen;
use Renderforest\ProjectData\Sound\Collection\SoundCollection;
use Renderforest\Sound\UserSound;

/**
* Class ProjectData
Expand Down Expand Up @@ -341,11 +342,22 @@ public function getSounds(): SoundCollection
return $this->sounds;
}

/**
* @return SoundCollection
*/
public function insertUniqueSound(UserSound $sound): ProjectData
{
$collection = new SoundCollection();
$this->sounds = $collection->add($sound);

return $this;
}

/**
* @param SoundCollection $sounds
* @return ProjectData
*/
public function setSounds(SoundCollection $sounds): ProjectData
private function setSounds(SoundCollection $sounds): ProjectData
{
$this->sounds = $sounds;

Expand Down

0 comments on commit 61791ff

Please sign in to comment.