Skip to content

Commit 9dcc0aa

Browse files
HP-1751 added PriceTypeDefinitionInterface::getTariffTypeDefinition() method
1 parent fe86956 commit 9dcc0aa

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/product/price/PriceTypeDefinition.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use hiqdev\php\billing\product\Domain\Model\Unit\FractionUnitInterface;
1515
use hiqdev\php\billing\product\Domain\Model\Unit\UnitInterface;
1616
use hiqdev\php\billing\product\quantity\QuantityFormatterInterface;
17+
use hiqdev\php\billing\product\TariffTypeDefinitionInterface;
1718
use hiqdev\php\billing\type\TypeInterface;
1819

1920
/**
@@ -173,4 +174,9 @@ public function getAggregate(): AggregateInterface
173174

174175
return $this->aggregate;
175176
}
177+
178+
public function getTariffTypeDefinition(): TariffTypeDefinitionInterface
179+
{
180+
return $this->parent->end();
181+
}
176182
}

src/product/price/PriceTypeDefinitionInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use hiqdev\php\billing\product\invoice\InvoiceRepresentationCollection;
99
use hiqdev\php\billing\product\quantity\FractionQuantityData;
1010
use hiqdev\php\billing\product\quantity\QuantityFormatterInterface;
11+
use hiqdev\php\billing\product\TariffTypeDefinitionInterface;
1112
use hiqdev\php\billing\type\TypeInterface;
1213

1314
interface PriceTypeDefinitionInterface extends HasBehaviorsInterface
@@ -45,4 +46,6 @@ public function getUnit(): UnitInterface;
4546
public function aggregation(AggregateInterface $aggregate): self;
4647

4748
public function getAggregate(): AggregateInterface;
49+
50+
public function getTariffTypeDefinition(): TariffTypeDefinitionInterface;
4851
}

0 commit comments

Comments
 (0)