1
0
mirror of synced 2025-02-20 22:23:14 +03:00

DDC-1527 - Port bugfix for master branch

This commit is contained in:
Benjamin Eberlei 2011-12-12 16:39:52 +01:00
parent bda98150c4
commit 43ef8765fd
2 changed files with 7 additions and 4 deletions

View File

@ -1433,7 +1433,7 @@ class BasicEntityPersister
{
switch (true) {
case (isset($this->_class->fieldMappings[$field])):
$type = Type::getType($this->_class->fieldMappings[$field]['type'])->getBindingType();
$type = $this->_class->fieldMappings[$field]['type'];
break;
case (isset($this->_class->associationMappings[$field])):
@ -1448,7 +1448,7 @@ class BasicEntityPersister
$type = null;
if (isset($targetClass->fieldNames[$targetColumn])) {
$type = Type::getType($targetClass->fieldMappings[$targetClass->fieldNames[$targetColumn]]['type'])->getBindingType();
$type = $targetClass->fieldMappings[$targetClass->fieldNames[$targetColumn]]['type'];
}
break;
@ -1456,8 +1456,8 @@ class BasicEntityPersister
default:
$type = null;
}
if (is_array($value)) {
$type = Type::getType( $type )->getBindingType();
$type += Connection::ARRAY_PARAM_OFFSET;
}

View File

@ -125,6 +125,9 @@ class TypeTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this->assertInstanceOf('DateTime', $dateTimeDb->datetime);
$this->assertEquals('2009-10-02 20:10:52', $dateTimeDb->datetime->format('Y-m-d H:i:s'));
$articles = $this->_em->getRepository( 'Doctrine\Tests\Models\Generic\DateTimeModel' )->findBy( array( 'datetime' => new \DateTime( "now" ) ) );
$this->assertEquals( 0, count( $articles ) );
}
public function testDqlQueryBindDateTimeInstance()
@ -176,4 +179,4 @@ class TypeTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this->assertInstanceOf('DateTime', $dateTime->time);
$this->assertEquals('19:27:20', $dateTime->time->format('H:i:s'));
}
}
}