Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setItems example
protected
function
saveBackup
(
$path
,
$filterString
,
$operations
,
$items
)
{
$backup
=
new
BackupModel
(
)
;
$backup
->
setFilterString
(
$filterString
)
;
$backup
->
setOperationString
(
$this
->
operationsToString
(
$operations
)
)
;
$backup
->
setItems
(
$items
)
;
$backup
->
setPath
(
$path
)
;
$backup
->
setHash
(
sha1_file
(
$path
)
)
;
$backup
->
setSize
(
(int)
filesize
(
$path
)
)
;
$backup
->
setDate
(
new
DateTime
(
)
)
;
$this
->
getDqlHelper
(
)
->
getEntityManager
(
)
->
persist
(
$backup
)
;
$this
->
getDqlHelper
(
)
->
getEntityManager
(
)
->
flush
(
$backup
)
;
}
/** * Dumps a given table to disc - as only needed columns are exported, this is quite fast * * @param string $table * @param string $name * @param int[] $ids * @param bool $newBackup * * @throws RuntimeException */