start on Tune::merge()
This commit is contained in:
@@ -273,7 +273,22 @@ class Tune implements EntityInterface
|
||||
*/
|
||||
protected function set($attribute, $value)
|
||||
{
|
||||
call_user_func([$this, 'set'.$attribute], [$value]);
|
||||
switch ($attribute) {
|
||||
case 'index':
|
||||
call_user_func([$this, 'set'.$attribute], $value);
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->append($attribute, $value);
|
||||
}
|
||||
}
|
||||
|
||||
protected function append($attribute, array $values)
|
||||
{
|
||||
$method = 'add' . substr($attribute, 0, -1);
|
||||
foreach ($values as $value) {
|
||||
call_user_func([$this, $method], $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -320,4 +335,11 @@ class Tune implements EntityInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function merge(Tune $source)
|
||||
{
|
||||
//TODO
|
||||
$this->titles = array_merge($this->getTitles(), $source->getTitles());
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user