Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
validateNumberOfActions example
private
array
$options
=
[
]
;
public
function
__construct
(
array
$options
=
[
]
)
{
if
(
\
array_key_exists
(
'themeColor',
$options
)
)
{
$this
->
validateThemeColor
(
$options
[
'themeColor'
]
)
;
}
$this
->options =
$options
;
$this
->
validateNumberOfActions
(
)
;
}
public
static
function
fromNotification
(
Notification
$notification
)
: self
{
$options
=
(
new
self
(
)
)
->
title
(
$notification
->
getSubject
(
)
)
->
text
(
$notification
->
getContent
(
)
)
;
if
(
$exception
=
$notification
->
getExceptionAsString
(
)
)
{
$options
->
section
(
(
new
Section
(
)
)
->
text
(
$exception
)
)
;
}