Changeset 5296
- Timestamp:
- 12/17/08 20:38:36 (7 months ago)
- Location:
- branches
- Files:
-
- 2 added
- 4 modified
-
1.0/lib/Doctrine/Table.php (modified) (1 diff)
-
1.0/tests/run.php (modified) (1 diff)
-
1.0/tests/Validator/ForeignKeysTestCase.php (added)
-
1.1/lib/Doctrine/Table.php (modified) (1 diff)
-
1.1/tests/run.php (modified) (1 diff)
-
1.1/tests/Validator/ForeignKeysTestCase.php (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/lib/Doctrine/Table.php
r5280 r5296 1676 1676 if ($value === self::$_null) { 1677 1677 $value = null; 1678 } else if ($value instanceof Doctrine_Record ) {1678 } else if ($value instanceof Doctrine_Record && $value->exists()) { 1679 1679 $value = $value->getIncremented(); 1680 } else if ($value instanceof Doctrine_Record && ! $value->exists()) { 1681 foreach($this->getRelations() as $relation) { 1682 if($fieldName == $relation->getLocalFieldName() && get_class($value) == $relation->getClass()) { 1683 return $errorStack; 1684 } 1685 } 1680 1686 } 1681 1687 -
branches/1.0/tests/run.php
r5168 r5296 183 183 $validators->addTestCase(new Doctrine_Validator_Future_TestCase()); 184 184 $validators->addTestCase(new Doctrine_Validator_Past_TestCase()); 185 $validators->addTestCase(new Doctrine_Validator_ForeignKeys_TestCase()); 185 186 $test->addTestCase($validators); 186 187 -
branches/1.1/lib/Doctrine/Table.php
r5280 r5296 1736 1736 if ($value === self::$_null) { 1737 1737 $value = null; 1738 } else if ($value instanceof Doctrine_Record ) {1738 } else if ($value instanceof Doctrine_Record && $value->exists()) { 1739 1739 $value = $value->getIncremented(); 1740 } else if ($value instanceof Doctrine_Record && ! $value->exists()) { 1741 foreach($this->getRelations() as $relation) { 1742 if($fieldName == $relation->getLocalFieldName() && get_class($value) == $relation->getClass()) { 1743 return $errorStack; 1744 } 1745 } 1740 1746 } 1741 1747 -
branches/1.1/tests/run.php
r5166 r5296 185 185 $validators->addTestCase(new Doctrine_Validator_Future_TestCase()); 186 186 $validators->addTestCase(new Doctrine_Validator_Past_TestCase()); 187 $validators->addTestCase(new Doctrine_Validator_ForeignKeys_TestCase()); 187 188 $test->addTestCase($validators); 188 189