public function PriceListItem::getPrice in Commerce Pricelist 8.2
Same name and namespace in other branches
- 8 src/Entity/PriceListItem.php \Drupal\commerce_pricelist\Entity\PriceListItem::getPrice()
Gets the price.
Return value
\Drupal\commerce_price\Price The price.
Overrides PriceListItemInterface::getPrice
1 call to PriceListItem::getPrice()
- PriceListItem::label in src/
Entity/ PriceListItem.php - Gets the label of the entity.
File
- src/
Entity/ PriceListItem.php, line 176
Class
- PriceListItem
- Defines the price list item entity.
Namespace
Drupal\commerce_pricelist\EntityCode
public function getPrice() {
if (!$this
->get('price')
->isEmpty()) {
return $this
->get('price')
->first()
->toPrice();
}
}