Skip to content

Commit c03cf95

Browse files
ProjectData: add insertUniqueSound method.
1 parent f55dbe8 commit c03cf95

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

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)