Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
anis
anis-server
Commits
813f3b4f
Commit
813f3b4f
authored
Sep 03, 2019
by
François Agneray
Browse files
Merge branch '35-probleme-lie-a-l-update-d-un-attribut' into 'develop'
#35
=> Fixed bug done Closes
#35
See merge request
!35
parents
5cd66f11
8e9f53bc
Pipeline
#1472
passed with stages
in 7 minutes and 20 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/Action/Meta/AttributeAction.php
View file @
813f3b4f
...
...
@@ -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'
]
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment