Merge branch 'DDC-2700'
This commit is contained in:
commit
22d4d2e812
@ -1093,9 +1093,14 @@ class ClassMetadataInfo implements ClassMetadata
|
|||||||
*/
|
*/
|
||||||
public function isIdentifier($fieldName)
|
public function isIdentifier($fieldName)
|
||||||
{
|
{
|
||||||
|
if ( ! $this->identifier) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if ( ! $this->isIdentifierComposite) {
|
if ( ! $this->isIdentifierComposite) {
|
||||||
return $fieldName === $this->identifier[0];
|
return $fieldName === $this->identifier[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
return in_array($fieldName, $this->identifier);
|
return in_array($fieldName, $this->identifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1091,6 +1091,25 @@ class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase
|
|||||||
|
|
||||||
$this->assertEquals(array('sequenceName' => 'foo', 'quoted' => true), $cm->sequenceGeneratorDefinition);
|
$this->assertEquals(array('sequenceName' => 'foo', 'quoted' => true), $cm->sequenceGeneratorDefinition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group DDC-2700
|
||||||
|
*/
|
||||||
|
public function testIsIdentifierMappedSuperClass()
|
||||||
|
{
|
||||||
|
$class = new ClassMetadata(__NAMESPACE__ . '\\DDC2700MappedSuperClass');
|
||||||
|
|
||||||
|
$this->assertFalse($class->isIdentifier('foo'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @MappedSuperclass
|
||||||
|
*/
|
||||||
|
class DDC2700MappedSuperClass
|
||||||
|
{
|
||||||
|
/** @Column */
|
||||||
|
private $foo;
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyNamespacedNamingStrategy extends \Doctrine\ORM\Mapping\DefaultNamingStrategy
|
class MyNamespacedNamingStrategy extends \Doctrine\ORM\Mapping\DefaultNamingStrategy
|
||||||
|
Loading…
Reference in New Issue
Block a user