BUGFIX: Pass correct class to allowPrimaryKeyEditing in yaml fixture (from r101171)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@111969 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-10-12 21:52:55 +00:00
parent 477709f0da
commit 25cddf944c

View File

@ -183,9 +183,9 @@ class YamlFixture extends Object {
// The database needs to allow inserting values into the foreign key column (ID in our case)
$conn = DB::getConn();
if(method_exists($conn, 'allowPrimaryKeyEditing')) $conn->allowPrimaryKeyEditing($dataClass, true);
if(method_exists($conn, 'allowPrimaryKeyEditing')) $conn->allowPrimaryKeyEditing(ClassInfo::baseDataClass($dataClass), true);
$obj->write(false, true);
if(method_exists($conn, 'allowPrimaryKeyEditing')) $conn->allowPrimaryKeyEditing($dataClass, false);
if(method_exists($conn, 'allowPrimaryKeyEditing')) $conn->allowPrimaryKeyEditing(ClassInfo::baseDataClass($dataClass), false);
}
// Populate the dictionary with the ID