Skip to content

Commit 61791ff

Browse files
Merge pull request #137 from renderforest/add-unique-sound-feature
ProjectData: add insertUniqueSound method.
2 parents f55dbe8 + 449fd1b commit 61791ff

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "renderforest/sdk-php",
33
"description": "Renderforest SDK for PHP",
4-
"version": "0.4.3",
4+
"version": "0.4.4",
55
"homepage": "https://github.com/renderforest/renderforest-sdk-php",
66
"authors": [
77
{

src/ProjectData/ProjectData.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Renderforest\ProjectData\Screen\Collection\ScreenCollection;
1111
use Renderforest\ProjectData\Screen\Entity\Screen;
1212
use Renderforest\ProjectData\Sound\Collection\SoundCollection;
13+
use Renderforest\Sound\UserSound;
1314

1415
/**
1516
* Class ProjectData
@@ -341,11 +342,22 @@ public function getSounds(): SoundCollection
341342
return $this->sounds;
342343
}
343344

345+
/**
346+
* @return SoundCollection
347+
*/
348+
public function insertUniqueSound(UserSound $sound): ProjectData
349+
{
350+
$collection = new SoundCollection();
351+
$this->sounds = $collection->add($sound);
352+
353+
return $this;
354+
}
355+
344356
/**
345357
* @param SoundCollection $sounds
346358
* @return ProjectData
347359
*/
348-
public function setSounds(SoundCollection $sounds): ProjectData
360+
private function setSounds(SoundCollection $sounds): ProjectData
349361
{
350362
$this->sounds = $sounds;
351363

0 commit comments

Comments
 (0)