Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setInstallationDate example
$localPlugin
->
setEncrypted
(
$storePlugin
->
isEncrypted
(
)
)
;
$localPlugin
->
setCertified
(
$storePlugin
->
isCertified
(
)
)
;
$localPlugin
->
setLicenceCheck
(
$storePlugin
->
hasLicenceCheck
(
)
)
;
if
(
!
$localPlugin
->
hasCapabilityDummy
(
)
)
{
$localPlugin
->
setCapabilityDummy
(
$storePlugin
->
hasCapabilityDummy
(
)
)
;
}
}
public
function
assignLocalPluginStruct
(
PluginStruct
$storePlugin
, PluginStruct
$localPlugin
)
{
$storePlugin
->
setId
(
$localPlugin
->
getId
(
)
)
;
$storePlugin
->
setInstallationDate
(
$localPlugin
->
getInstallationDate
(
)
)
;
$storePlugin
->
setActive
(
$localPlugin
->
isActive
(
)
)
;
$storePlugin
->
setSource
(
$localPlugin
->
getSource
(
)
)
;
$storePlugin
->
setLicence
(
$localPlugin
->
getLicence
(
)
)
;
$storePlugin
->
setCapabilityActivate
(
$localPlugin
->
hasCapabilityActivate
(
)
)
;
$storePlugin
->
setCapabilityInstall
(
$localPlugin
->
hasCapabilityInstall
(
)
)
;
$storePlugin
->
setCapabilitySecureUninstall
(
$localPlugin
->
hasCapabilitySecureUninstall
(
)
)
;
$storePlugin
->
setLocalDescription
(
$localPlugin
->
getLocalDescription
(
)
)
;
$storePlugin
->
setLink
(
$localPlugin
->
getLink
(
)
)
;
$storePlugin
->
setRedirectToStore
(
$localPlugin
->
isRedirectToStore
(
)
)
;
$storePlugin
->
setLowestPrice
(
$localPlugin
->
getLowestPrice
(
)
)
;
$expiredPlugins
)
;
try
{
$plugins
=
$this
->
get
(
PluginStoreService::
class
)
->
getPlugins
(
$context
)
;
foreach
(
$plugins
as
$plugin
)
{
if
(
isset
(
$installDates
[
$plugin
->
getTechnicalName
(
)
]
)
)
{
$date
=
$installDates
[
$plugin
->
getTechnicalName
(
)
]
[
'installation_date'
]
;
if
(
$date
)
{
$plugin
->
setInstallationDate
(
new
DateTime
(
$date
)
)
;
}
$plugin
->
setCapabilitySecureUninstall
(
$installDates
[
$plugin
->
getTechnicalName
(
)
]
[
'capability_secure_uninstall'
]
)
;
}
}
$this
->
View
(
)
->
assign
(
[
'success' => true, 'data' =>
array_values
(
$plugins
)
]
)
;
}
catch
(
Exception
$e
)
{
$this
->
View
(
)
->
assign
(
[
'success' => false, 'message' =>
$e
->
getMessage
(
)
]
)
;
}
}