We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be007f7 commit ab1f2f5Copy full SHA for ab1f2f5
src/product/BehaviorInterface.php
@@ -4,5 +4,5 @@
4
5
interface BehaviorInterface
6
{
7
- public function execute(): void;
+ public function class(): string;
8
}
src/product/BillingRegistry.php
@@ -82,4 +82,15 @@ public function getConsumptionGroups(): \Generator
82
yield $tariffType->consumption()->groups();
83
84
85
+
86
+ public function behavior(string $behaviorClassWrapper): \Generator
87
+ {
88
+ foreach ($this->priceTypes() as $priceTypeDefinition) {
89
+ foreach ($priceTypeDefinition->withBehaviors() as $behavior) {
90
+ if ($behavior instanceof $behaviorClassWrapper) {
91
+ yield $behavior;
92
+ }
93
94
95
96
0 commit comments