add authors, composers, history and settings to Tune::merge()

This commit is contained in:
2018-05-10 21:34:53 -04:00
parent 82dc3de079
commit d4d3654653
12 changed files with 640 additions and 28 deletions

View File

@@ -283,6 +283,16 @@ class Tune implements EntityInterface
call_user_func([$this, 'addAuthor'], $value);
break;
case 'Composers':
$this->addComposer($value);
break;
case 'settings':
foreach ($value as $key => $settingParams) {
$this->addSetting(Setting::create($settingParams));
}
break;
default:
$this->append($attribute, $value);
}
@@ -333,6 +343,7 @@ class Tune implements EntityInterface
/**
* @param StringAtom $musicLine
* @return $this
* @deprecated this should be on the setting
*/
public function addMusicLine(string $musicLine)
{
@@ -350,6 +361,10 @@ class Tune implements EntityInterface
{
//TODO
$this->titles = array_merge($this->getTitles(), $source->getTitles());
$this->authors = array_merge($this->getAuthors(), $source->getAuthors());
$this->composers = array_merge($this->getComposers(), $source->getComposers());
$this->history = array_merge($this->getHistory(), $source->getHistory());
$this->tuneSettings = array_merge($this->getSettings(), $source->getSettings());
return $this;
}
}