Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getFreeSerialCount example
$esd
=
$this
->
get
(
'models'
)
->
getRepository
(
Esd::
class
)
->
find
(
$esdId
)
;
if
(
!
$esd
)
{
$this
->
View
(
)
->
assign
(
[
'success' => false,
'message' =>
sprintf
(
'ESD by id %s not found',
$esdId
)
,
]
)
;
return
;
}
$freeSerialsCount
=
$this
->
getFreeSerialCount
(
$esdId
)
;
$variant
=
$esd
->
getArticleDetail
(
)
;
$variant
->
setInStock
(
$freeSerialsCount
)
;
$esd
->
fromArray
(
$this
->
Request
(
)
->
getPost
(
)
)
;
$this
->
getManager
(
)
->
flush
(
)
;
$this
->
View
(
)
->
assign
(
[
'data' =>
$this
->
Request
(
)
->
getPost
(
)
,
'success' => true,
]
)
;
}