Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
isValidExpression example
$interval
=
$data
->
getValue
(
)
;
if
(
$interval
=== null
)
{
yield
$field
->
getStorageName
(
)
=> null;
return
;
}
if
(
\
is_string
(
$interval
)
)
{
if
(
!CronExpression::
isValidExpression
(
$interval
)
)
{
throw
DataAbstractionLayerException::
invalidCronIntervalFormat
(
$interval
)
;
}
$interval
=
new
CronExpression
(
$interval
)
;
}
$data
->
setValue
(
$interval
)
;
$this
->
validateIfNeeded
(
$field
,
$existence
,
$data
,
$parameters
)
;
if
(
!
$interval
instanceof CronExpression
)
{
yield
$field
->
getStorageName
(
)
=> null;