Skip to content

Commit

Permalink
Always set configKeyName on connections.
Browse files Browse the repository at this point in the history
This is useful in fixtures for figuring out where a fixture was added.
This property will hopefully be removed, but for now it is a necessary
crutch.
  • Loading branch information
markstory committed May 25, 2013
1 parent a17a69f commit b54795c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/Cake/Database/Connection.php
Expand Up @@ -31,6 +31,13 @@ class Connection {

use TypeConverterTrait;

/**
* The configuration name used for this connection.
*
* @var string
*/
public $configKeyName = null;

/**
* Contains the configuration params for this connection
*
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Model/ConnectionManager.php
Expand Up @@ -114,8 +114,8 @@ public static function getDataSource($name) {
static::$_dataSources[$name] = new Connection(static::$config[$name]);
} else {
static::$_dataSources[$name] = new $class(static::$config[$name]);
static::$_dataSources[$name]->configKeyName = $name;
}
static::$_dataSources[$name]->configKeyName = $name;

return static::$_dataSources[$name];
}
Expand Down

0 comments on commit b54795c

Please sign in to comment.