Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
conversionFailedFormat example
$value
->
format
(
$platform
->
getDateFormatString
(
)
)
: null;
}
public
function
convertToPHPValue
(
$value
, AbstractPlatform
$platform
)
{
if
(
$value
=== null
)
{
return
null;
}
$val
= DateTime::
createFromFormat
(
'!' .
$platform
->
getDateFormatString
(
)
,
$value
)
;
if
(
!
$val
)
{
throw
ConversionException::
conversionFailedFormat
(
$value
,
$this
->
getName
(
)
,
$platform
->
getDateFormatString
(
)
)
;
}
return
$val
;
}
}
$value
->
format
(
$platform
->
getDateTimeFormatString
(
)
)
: null;
}
public
function
convertToPHPValue
(
$value
, AbstractPlatform
$platform
)
{
if
(
$value
=== null
)
{
return
null;
}
$val
= DateTime::
createFromFormat
(
$platform
->
getDateTimeFormatString
(
)
,
$value
)
;
if
(
!
$val
)
{
throw
ConversionException::
conversionFailedFormat
(
$value
,
$this
->
getName
(
)
,
$platform
->
getDateTimeFormatString
(
)
)
;
}
return
$val
;
}
}