Commit 2e1b1619 authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Corrige l'affichage des identifiants.

parent 23467d72
...@@ -25,7 +25,8 @@ class FieldDecorator extends AbstractDoctrineDecorator ...@@ -25,7 +25,8 @@ class FieldDecorator extends AbstractDoctrineDecorator
protected function extractItems(ReflectionClass $class) protected function extractItems(ReflectionClass $class)
{ {
return $this->withMetadata( return $this->withMetadata(
function ($metadata) { function (ClassMetadata $metadata) {
/* @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */
return $metadata->fieldMappings; return $metadata->fieldMappings;
}, },
$class $class
...@@ -35,17 +36,18 @@ class FieldDecorator extends AbstractDoctrineDecorator ...@@ -35,17 +36,18 @@ class FieldDecorator extends AbstractDoctrineDecorator
protected function decorateItem(ReflectionClass $class, NodeInterface $node, ClassVisitorInterface $visitor, $field) protected function decorateItem(ReflectionClass $class, NodeInterface $node, ClassVisitorInterface $visitor, $field)
{ {
$isIdentifier = $this->withMetadata( $isIdentifier = $this->withMetadata(
function ($metadata) use ($field) { function (ClassMetadata $metadata) use ($field) {
/* @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */
return $metadata->isIdentifier($field['fieldName']); return $metadata->isIdentifier($field['fieldName']);
}, },
$class $class
); );
$node->addAttribute(new Field( $node->addAttribute(new Field(
$field['fieldName'], $field['fieldName'],
$field['type'], $field['type'],
$field['unique'], $field['unique'],
$field['nullable'] $field['nullable'],
$isIdentifier
)); ));
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment