Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
loadContacts example
public
function
flush
(
)
: void
{
if
(
empty
(
$this
->entries
)
||
$this
->flushError
)
{
return
;
}
$this
->connection->
beginTransaction
(
)
;
try
{
$contacts
=
$this
->
loadContacts
(
)
;
foreach
(
$this
->entries
as
$entry
)
{
$this
->connection->
insert
(
's_mail_log',
[
'type_id' =>
$entry
->
getType
(
)
?
$entry
->
getType
(
)
->
getId
(
)
: null,
'order_id' =>
$entry
->
getOrder
(
)
?
$entry
->
getOrder
(
)
->
getId
(
)
: null,
'shop_id' =>
$entry
->
getShop
(
)
?
$entry
->
getShop
(
)
->
getId
(
)
: null,
'subject' =>
$entry
->
getSubject
(
)
,
'sender' =>
(string)
$entry
->
getSender
(
)
,
'sent_at' =>
$entry
->
getSentAt
(
)
->
format
(
'Y-m-d H:i:s'
)
,
'content_html' =>
$entry
->
getContentHtml
(
)
,
'content_text' =>
$entry
->
getContentText
(
)
,
]
)
;