Changeset 4283

Show
Ignore:
Timestamp:
04/21/08 22:19:13 (15 months ago)
Author:
jwage
Message:

fixes #974

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/0.11/lib/Doctrine/Data/Import.php

    r4249 r4283  
    168168        $relation = $record->getTable()->getRelation($relationName); 
    169169        if ($relation->getClass() !== get_class($relatedRowKeyObject)) { 
    170             throw new Doctrine_Data_Exception('Class referred to is expected to be "' . get_class($relatedRowKeyObject) . '" and "' . $relation->getClass() .'" was given'); 
     170            if ( ! is_subclass_of($relatedRowKeyObject, $relation->getClass())) { 
     171                throw new Doctrine_Data_Exception(sprintf( 
     172                    'Class referred to is expected to be "%s" and "%s" was given', 
     173                    get_class($relatedRowKeyObject), $relation->getClass())); 
     174            } 
    171175        } 
    172176