public function Shipment::clearAdjustments in Commerce Shipping 8.2
Removes all adjustments that belong to the shipment.
Return value
$this
Overrides ShipmentInterface::clearAdjustments
File
- src/
Entity/ Shipment.php, line 413
Class
- Shipment
- Defines the shipment entity class.
Namespace
Drupal\commerce_shipping\EntityCode
public function clearAdjustments() {
$locked_callback = function ($adjustment) {
/** @var \Drupal\commerce_order\Adjustment $adjustment */
return $adjustment
->isLocked();
};
$adjustments = array_filter($this
->getAdjustments(), $locked_callback);
$this
->setAdjustments($adjustments);
return $this;
}