Skip to content

Commit

Permalink
fix field options_code indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
IndraGunawan committed Feb 29, 2024
1 parent 2584cf7 commit fd7a6fc
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Doctrine/EntityDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,18 @@ public function getFormFields(): array
}
$fieldsWithTypes[$fieldName] = [
'type' => EntityType::class,
'options_code' => sprintf('\'class\' => %s::class,', $relation['targetEntity']).\PHP_EOL.'\'choice_label\' => \'id\',',
'options_code' => <<<EOF
'class' => {$relation['targetEntity']}::class,
'choice_label' => 'id',
EOF,
'extra_use_classes' => [$relation['targetEntity']],
];

if (\Doctrine\ORM\Mapping\ClassMetadata::MANY_TO_MANY === $relation['type']) {
$fieldsWithTypes[$fieldName]['options_code'] .= "\n'multiple' => true,";
$fieldsWithTypes[$fieldName]['options_code'] .= <<<EOF
'multiple' => true,
EOF;
}
}

Expand Down

0 comments on commit fd7a6fc

Please sign in to comment.