Skip to content

Commit

Permalink
Gestion des liaisons pour le setPropertiesToEntity
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume DUBOST committed Mar 6, 2020
1 parent 16222ba commit e6ab1e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Entity/AbstractEntityService.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ protected function setPropertiesToEntity(array $datas, array $validation_groups,
$filtered_datas = [];
$validation_field_metadata = $this->validator->getMetadataFor($entity)->members;
$doctrine_field_metadata = $this->em->getClassMetadata(get_class($entity))->fieldMappings;
$all_fields = array_keys($doctrine_field_metadata);
$doctrine_assoc_metadata = $this->em->getClassMetadata(get_class($entity))->associationMappings;
$all_fields = array_keys(array_merge($doctrine_field_metadata, $doctrine_assoc_metadata));

foreach ($datas as $field_name => $data_value) {
$is_field_concerned = false;
Expand Down

0 comments on commit e6ab1e4

Please sign in to comment.