Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
generateExport example
public
function
indexAction
(
)
{
$this
->
prepareExport
(
)
;
$this
->
sendHeaders
(
)
;
$productFeed
=
$this
->
get
(
'models'
)
->
getRepository
(
'\Shopware\Models\ProductFeed\ProductFeed'
)
->
find
(
(int)
$this
->
Request
(
)
->feedID
)
;
// Live generation
if
(
$productFeed
->
getInterval
(
)
=== 0
)
{
$this
->
generateExport
(
'php://output'
)
;
return
;
}
$directory
=
$this
->
createOutputDirectory
(
)
;
$fileName
=
$productFeed
->
getHash
(
)
. '_' .
$productFeed
->
getFileName
(
)
;
$filePath
=
$directory
.
$fileName
;
if
(
$productFeed
->
getInterval
(
)
=== -1 &&
file_exists
(
$filePath
)
)
{
readfile
(
$filePath
)
;