Commit 8e9f53bc authored by François Agneray's avatar François Agneray
Browse files

#35 => Fixed bug done

parent 5cd66f11
......@@ -103,28 +103,7 @@ final class AttributeAction
if ($request->isPut()) {
$parsedBody = $request->getParsedBody();
if (is_null($parsedBody['id_criteria_family'])) {
$criteriaFamily = null;
} else {
$criteriaFamily = $this->memf->getMetaEntityManager()->find(
'App\Entity\Metamodel\CriteriaFamily',
$parsedBody['id_criteria_family']
);
}
if (is_null($parsedBody['id_output_category'])) {
$outputCategory = null;
} else {
$outputCategory = $this->memf->getMetaEntityManager()->find(
'App\Entity\Metamodel\OutputCategory',
$parsedBody['id_output_category']
);
}
$this->editAttribute($attribute, $parsedBody, $criteriaFamily, $outputCategory);
$this->memf->getMetaEntityManager()->flush();
$this->editAttribute($attribute, $parsedBody);
$newResponse = $response->withJson($attribute);
}
......@@ -133,9 +112,7 @@ final class AttributeAction
private function editAttribute(
Attribute $attribute,
array $parsedBody,
CriteriaFamily $criteriaFamily = null,
OutputCategory $outputCategory = null
array $parsedBody
): void {
$attribute->setLabel($parsedBody['label']);
$attribute->setFormLabel($parsedBody['form_label']);
......@@ -169,7 +146,7 @@ final class AttributeAction
$criteriaFamily = null;
} else {
$criteriaFamily = $this->memf->getMetaEntityManager()->find(
'App\Entity\CriteriaFamily',
'App\Entity\Metamodel\CriteriaFamily',
$parsedBody['id_criteria_family']
);
}
......@@ -178,7 +155,7 @@ final class AttributeAction
$outputCategory = null;
} else {
$outputCategory = $this->memf->getMetaEntityManager()->find(
'App\Entity\OutputCategory',
'App\Entity\Metamodel\OutputCategory',
$parsedBody['id_output_category']
);
}
......
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