Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
NewsletterRecipientTaskHandler example
static
::
assertIsString
(
$salutationSql
)
;
$this
->
getContainer
(
)
->
get
(
Connection::
class
)
->
executeStatement
(
$salutationSql
)
;
$recipientSql
=
file_get_contents
(
__DIR__ . '/../fixtures/recipient.sql'
)
;
static
::
assertIsString
(
$recipientSql
)
;
$recipientSql
=
str_replace
(
':createdAt',
(
new
\
DateTime
(
)
)
->
format
(
Defaults::STORAGE_DATE_TIME_FORMAT
)
,
$recipientSql
)
;
$this
->
getContainer
(
)
->
get
(
Connection::
class
)
->
executeStatement
(
$recipientSql
)
;
}
private
function
getTaskHandler
(
)
: NewsletterRecipientTaskHandler
{
return
new
NewsletterRecipientTaskHandler
(
$this
->
getContainer
(
)
->
get
(
'scheduled_task.repository'
)
,
$this
->
getContainer
(
)
->
get
(
'newsletter_recipient.repository'
)
)
;
}
}