public function Payment::getLineItemsByType in Payment 8.2
Gets line items by plugin type.
Parameters
string $plugin_id: The line item plugin's ID.
Return value
\Drupal\payment\Plugin\Payment\LineItem\PaymentLineItemInterface[]
Overrides LineItemCollectionInterface::getLineItemsByType
File
- src/
Entity/ Payment.php, line 205
Class
- Payment
- Defines a payment entity.
Namespace
Drupal\payment\EntityCode
public function getLineItemsByType($plugin_id) {
$line_items = [];
foreach ($this
->getLineItems() as $name => $line_item) {
if ($line_item
->getPluginId() == $plugin_id) {
$line_items[$name] = $line_item;
}
}
return $line_items;
}