Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Pôle IS
Bundles Symfony 2
ng-model-generator-bundle
Commits
9422cc38
Commit
9422cc38
authored
Apr 16, 2019
by
Guillaume Perréal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Utilisation correcte des attributs "input" et "output".
parent
d243059d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
24 deletions
+34
-24
src/php/Metadata/MetadataFactory.php
src/php/Metadata/MetadataFactory.php
+34
-24
No files found.
src/php/Metadata/MetadataFactory.php
View file @
9422cc38
...
@@ -253,33 +253,43 @@ final class MetadataFactory implements MetadataFactoryInterface
...
@@ -253,33 +253,43 @@ final class MetadataFactory implements MetadataFactoryInterface
$opDef
=
new
OperationDef
(
$name
,
$method
,
$type
===
OperationType
::
COLLECTION
);
$opDef
=
new
OperationDef
(
$name
,
$method
,
$type
===
OperationType
::
COLLECTION
);
$input
=
$getAttribute
(
'input'
,
null
);
if
(
$input
===
null
&&
$opDef
->
hasNormalization
())
{
$input
=
$class
->
getFullName
();
}
if
(
is_array
(
$input
)
&&
isset
(
$input
[
'class'
]))
{
$input
=
$input
[
'class'
];
}
$normalization
=
$input
?
$this
->
getOperationSerialization
(
$opDef
,
PHPClass
::
get
(
$input
),
true
,
$getAttribute
(
'normalization_context'
,
[])[
'groups'
]
??
[]
)
:
null
;
$output
=
$getAttribute
(
'output'
,
null
);
$output
=
$getAttribute
(
'output'
,
null
);
if
(
$input
===
null
&&
$opDef
->
hasDenormalization
())
{
$normalization
=
null
;
$output
=
$class
->
getFullName
();
if
(
$output
!==
false
)
{
if
(
is_array
(
$output
)
&&
isset
(
$output
[
'class'
]))
{
$output
=
$output
[
'class'
];
}
if
(
$output
===
null
&&
$opDef
->
hasNormalization
())
{
$output
=
$class
->
getFullName
();
}
if
(
$output
)
{
$normalization
=
$this
->
getOperationSerialization
(
$opDef
,
PHPClass
::
get
(
$output
),
true
,
$getAttribute
(
'normalization_context'
,
[])[
'groups'
]
??
[]
);
}
}
}
if
(
is_array
(
$output
)
&&
isset
(
$output
[
'class'
]))
{
$output
=
$output
[
'class'
];
$input
=
$getAttribute
(
'input'
,
null
);
$denormalization
=
null
;
if
(
$input
!==
false
)
{
if
(
is_array
(
$input
)
&&
isset
(
$input
[
'class'
]))
{
$input
=
$input
[
'class'
];
}
if
(
$input
===
null
&&
$opDef
->
hasDenormalization
())
{
$input
=
$class
->
getFullName
();
}
if
(
$input
)
{
$denormalization
=
$this
->
getOperationSerialization
(
$opDef
,
PHPClass
::
get
(
$input
),
false
,
$getAttribute
(
'denormalization_context'
,
[])[
'groups'
]
??
[]
);
}
}
}
$denormalization
=
$output
?
$this
->
getOperationSerialization
(
$opDef
,
PHPClass
::
get
(
$output
),
false
,
$getAttribute
(
'denormalization_context'
,
[])[
'groups'
]
??
[]
)
:
null
;
return
new
OperationMetadata
(
return
new
OperationMetadata
(
$opDef
,
$opDef
,
...
...
Write
Preview
Markdown
is supported
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