DDC-1527 - Port bugfix for master branch
This commit is contained in:
parent
bda98150c4
commit
43ef8765fd
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user