File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 22
33namespace hiqdev \php \billing \product \price ;
44
5+ use hiqdev \billing \registry \Type \TypeSemantics ;
56use hiqdev \php \billing \product \AggregateInterface ;
67use hiqdev \php \billing \product \Exception \AggregateNotDefinedException ;
78use hiqdev \php \billing \product \behavior \BehaviorPriceTypeDefinitionCollection ;
@@ -209,4 +210,11 @@ public function belongsToTariffType(string $tariffTypeName): bool
209210 {
210211 return $ this ->getTariffTypeDefinition ()->tariffType ()->equalsName ($ tariffTypeName );
211212 }
213+
214+ public function belongsToPriceType (PriceTypeInterface $ priceType ): bool
215+ {
216+ $ typeSemantics = new TypeSemantics ();
217+
218+ return $ typeSemantics ->belongsToLocalCategory ($ this ->type (), $ priceType ->name ());
219+ }
212220}
Original file line number Diff line number Diff line change @@ -54,4 +54,8 @@ public function getAggregate(): AggregateInterface;
5454 * @return TariffTypeDefinitionInterface
5555 */
5656 public function getTariffTypeDefinition (): TariffTypeDefinitionInterface ;
57+
58+ public function belongsToTariffType (string $ tariffTypeName ): bool ;
59+
60+ public function belongsToPriceType (PriceTypeInterface $ priceType ): bool ;
5761}
You can’t perform that action at this time.
0 commit comments