Skip to content

Commit d9a5ef7

Browse files
HP-1751 added TariffTypeDefinition::hasBehavior() method
1 parent 9b8bb1d commit d9a5ef7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/product/TariffTypeDefinition.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ public function withBehaviors(): TariffTypeBehaviorCollection
4848
return $this->behaviorCollection;
4949
}
5050

51+
public function hasBehavior(string $behaviorClassName): bool
52+
{
53+
foreach ($this->behaviorCollection as $behavior) {
54+
if ($behavior instanceof $behaviorClassName) {
55+
return true;
56+
}
57+
}
58+
59+
return false;
60+
}
61+
5162
public function end(): self
5263
{
5364
// Validate the TariffType and lock its state

0 commit comments

Comments
 (0)