Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getMaxRedemptionsPerCustomer example
public
function
isOrderCountValid
(
)
: bool
{
return
$this
->
getMaxRedemptionsGlobal
(
)
=== null
||
$this
->
getMaxRedemptionsGlobal
(
)
<= 0
||
$this
->
getOrderCount
(
)
<
$this
->
getMaxRedemptionsGlobal
(
)
;
}
public
function
isOrderCountPerCustomerCountValid
(
string
$customerId
)
: bool
{
$customerId
=
mb_strtolower
(
$customerId
)
;
return
$this
->
getMaxRedemptionsPerCustomer
(
)
=== null
||
$this
->
getMaxRedemptionsPerCustomer
(
)
<= 0
||
$this
->
getOrdersPerCustomerCount
(
)
=== null
|| !\
array_key_exists
(
$customerId
,
$this
->
getOrdersPerCustomerCount
(
)
)
||
$this
->
getOrdersPerCustomerCount
(
)
[
$customerId
]
<
$this
->
getMaxRedemptionsPerCustomer
(
)
;
}
}