Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getFallbackQuery example
public
function
loadEsdOfCustomer
(
int
$customerId
, int
$esdId
)
: Esd
{
$query
=
$this
->
getDefaultQuery
(
)
->
setParameter
(
'customerId',
$customerId
)
->
setParameter
(
'esdId',
$esdId
)
;
$result
=
$query
->
execute
(
)
->
fetch
(
)
;
if
(
empty
(
$result
)
)
{
$query
=
$this
->
getFallbackQuery
(
)
->
setParameter
(
'customerId',
$customerId
)
->
setParameter
(
'esdId',
$esdId
)
;
$result
=
$query
->
execute
(
)
->
fetch
(
)
;
}
if
(
empty
(
$result
)
)
{
throw
new
EsdNotFoundException
(
)
;
}
return
$this
->esdHydrator->
hydrate
(
$result
)
;
}