Ticket #974 (closed defect: fixed)
Type checking when importing fixtures too restrictive since r4249
| Reported by: | thomas.s | Owned by: | jwage |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.11.0 |
| Component: | Import/Export | Version: | 0.11.0 |
| Severity: | Keywords: | inheritance | |
| Cc: | Has Test: | ||
| Status: | Has Patch: |
Description
Since r4249 the function _getImportedObject() of Doctrine_Data_Import is throwing an exception when the target object of a relation does not exactly match the specified class in the schema. This breaks my column aggregation inheritance, because now sub classes are not allowed to use the relations of their parents. But that was my intention when i went for inheritance in the first place...
My situation:
- User has Groups
- Expert extends User => Expert has Groups
r4249 is breaking this.
I added a patch and a test case, which can only be used like pseudo code because it's a PHPUnit test case and i'm kind of struggling with the Doctrine test setup. But it should make my intentions clear. I hope somebody can have a look at my proposal and correct me if I am wrong.
I am using Symfony 1.0 with sfDoctrine (0.11 branch).
if ($relation->getClass() !== get_class($relatedRowKeyObject)) {
...
$ php -v
PHP 5.2.5 (cli) (built: Apr 11 2008 12:49:32)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with Xdebug v2.0.3, Copyright (c) 2002-2007, by Derick Rethans
$ apachectl -v Server version: Apache/2.2.8 (Unix) Server built: Apr 11 2008 12:35:43
$ sqlite3 -version 3.5.7
$ mysql -V mysql Ver 14.12 Distrib 5.0.51, for apple-darwin9.1.0 (i686) using EditLine wrapper