Skip to content
Permalink
Browse files

Relocate config options merge

  • Loading branch information...
codeguy committed Jun 16, 2015
1 parent 0a5bad6 commit c4a2eaafa4764951c07f89aa8ffaf7b520832802
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/ORM/TableRegistry.php
@@ -169,6 +169,10 @@ public static function get($alias, array $options = [])
list(, $classAlias) = pluginSplit($alias);
$options = ['alias' => $classAlias] + $options;
if (isset(static::$_config[$alias])) {
$options += static::$_config[$alias];
}
if (empty($options['className'])) {
$options['className'] = Inflector::camelize($alias);
}
@@ -183,9 +187,6 @@ public static function get($alias, array $options = [])
$options['className'] = 'Cake\ORM\Table';
}
if (isset(static::$_config[$alias])) {
$options = static::$_config[$alias] + $options;
}
if (empty($options['connection'])) {
$connectionName = $options['className']::defaultConnectionName();
$options['connection'] = ConnectionManager::get($connectionName);

0 comments on commit c4a2eaa

Please sign in to comment.
You can’t perform that action at this time.