Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
BackupModel example
/** * Creates a backup model for a given backup * * @param string $path * @param string $filterString * @param array $operations * @param int $items */
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
)
;