You are here

public function InvoiceItem::addAdjustment in Commerce Invoice 8.2

Adds an adjustment.

Parameters

\Drupal\commerce_order\Adjustment $adjustment: The adjustment.

Return value

$this

Overrides EntityAdjustableInterface::addAdjustment

File

src/Entity/InvoiceItem.php, line 185

Class

InvoiceItem
Defines the invoice item entity class.

Namespace

Drupal\commerce_invoice\Entity

Code

public function addAdjustment(Adjustment $adjustment) {
  $this
    ->get('adjustments')
    ->appendItem($adjustment);
  return $this;
}