public function Invoice::hasItem in Commerce Invoice 8.2
Checks whether the invoice has a given invoice item.
Parameters
\Drupal\commerce_invoice\Entity\InvoiceItemInterface $invoice_item: The invoice item.
Return value
bool TRUE if the invoice item was found, FALSE otherwise.
Overrides InvoiceInterface::hasItem
File
- src/
Entity/ Invoice.php, line 274
Class
- Invoice
- Defines the invoice entity class.
Namespace
Drupal\commerce_invoice\EntityCode
public function hasItem(InvoiceItemInterface $invoice_item) {
return $this
->getItemIndex($invoice_item) !== FALSE;
}