CodeExplorer filterForContext example
return new RuleLoaderResult($cart,
$rules);
});
} private function loadRules(Context
$context): RuleCollection
{ if ($this->rules !== null
) { return $this->rules;
} return $this->rules =
$this->ruleLoader->
load($context)->
filterForContext();
} private function cartChanged(Cart
$previous, Cart
$current): bool
{ $previousLineItems =
$previous->
getLineItems();
$currentLineItems =
$current->
getLineItems();
return $previousLineItems->
count() !==
$currentLineItems->
count() ||
$previous->
getPrice()->
getTotalPrice() !==
$current->
getPrice()->
getTotalPrice() ||
$previousLineItems->
getKeys() !==
$currentLineItems->
getKeys() ||
$previousLineItems->
getTypes() !==
$currentLineItems->
getTypes() ;