Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getOrderDocumentsQuery example
if
(
$data
->orders === null || \
count
(
$data
->orders
)
=== 0
)
{
$this
->
View
(
)
->
assign
(
[
'success' => false,
'message' => 'No valid order id passed.',
]
)
;
return
;
}
$files
=
[
]
;
$models
=
$this
->
getOrderDocumentsQuery
(
$data
->orders,
$data
->docType
)
->
getResult
(
)
;
foreach
(
$models
as
$model
)
{
foreach
(
$model
->
getDocuments
(
)
as
$document
)
{
$file
=
$this
->
downloadFileFromFilesystem
(
sprintf
(
'documents/%s.pdf',
$document
->
getHash
(
)
)
)
;
if
(
$file
!== null
)
{
$files
[
]
=
$file
;
}
}
}
$this
->
mergeDocuments
(
$files
)
;