File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 33namespace hiqdev \php \billing \product ;
44
55use hiqdev \php \billing \product \behavior \InvalidBehaviorException ;
6+ use hiqdev \php \billing \product \Domain \Model \TariffTypeInterface ;
67use hiqdev \php \billing \product \Exception \AggregateNotFoundException ;
78use hiqdev \php \billing \product \Exception \BillingRegistryLockedException ;
89use hiqdev \php \billing \product \invoice \InvalidRepresentationException ;
@@ -180,4 +181,15 @@ public function getAggregate(string $type): AggregateInterface
180181
181182 throw new AggregateNotFoundException ('Aggregate was not found ' );
182183 }
184+
185+ public function getTariffTypeDefinitionByTariffType (TariffTypeInterface $ tariffType ): TariffTypeDefinitionInterface
186+ {
187+ foreach ($ this ->tariffTypeDefinitions as $ tariffTypeDefinition ) {
188+ if ($ tariffTypeDefinition ->tariffType () === $ tariffType ) {
189+ return $ tariffTypeDefinition ;
190+ }
191+ }
192+
193+ throw new TariffTypeDefinitionNotFoundException ('Tariff type definition was not found ' );
194+ }
183195}
You can’t perform that action at this time.
0 commit comments