More development

This commit is contained in:
Simon Sessingø
2016-11-19 05:22:51 +01:00
parent 4e12cb8bc3
commit d4a04920b8
5 changed files with 57 additions and 45 deletions
+16 -8
View File
@@ -78,21 +78,29 @@ class RouterGroup extends RouterEntry
return $this->prefix;
}
public function setData(array $settings)
/**
* Merge with information from another route.
*
* @param array $values
* @return static
*/
public function merge(array $values)
{
if (isset($settings['prefix'])) {
$this->setPrefix($settings['prefix']);
if (isset($values['prefix'])) {
$this->setPrefix($values['prefix']);
}
if (isset($settings['exceptionHandler'])) {
$this->setExceptionHandlers((array)$settings['exceptionHandler']);
if (isset($values['exceptionHandler'])) {
$this->setExceptionHandlers((array)$values['exceptionHandler']);
}
if (isset($settings['domain'])) {
$this->setDomains((array)$settings['domain']);
if (isset($values['domain'])) {
$this->setDomains((array)$values['domain']);
}
return parent::setData($settings);
parent::merge($values);
return $this;
}
}