Skip to content
Permalink
Browse files

Always set configKeyName on connections.

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 b54795c175c96fa854c6bda1c8559c8bc144f1b6
Showing with 8 additions and 1 deletion.
  1. +7 −0 lib/Cake/Database/Connection.php
  2. +1 −1 lib/Cake/Model/ConnectionManager.php
@@ -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
*
@@ -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];
}

0 comments on commit b54795c

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