You are here

public function Adjustment::toArray in Commerce Core 8.2

Gets the array representation of the adjustment.

Return value

array The array representation of the adjustment.

4 calls to Adjustment::toArray()
Adjustment::add in modules/order/src/Adjustment.php
Adds the given adjustment to the current adjustment.
Adjustment::divide in modules/order/src/Adjustment.php
Divides the adjustment amount by the given number.
Adjustment::multiply in modules/order/src/Adjustment.php
Multiplies the adjustment amount by the given number.
Adjustment::subtract in modules/order/src/Adjustment.php
Subtracts the given adjustment from the current adjustment.

File

modules/order/src/Adjustment.php, line 205

Class

Adjustment
Represents an adjustment.

Namespace

Drupal\commerce_order

Code

public function toArray() : array {
  return [
    'type' => $this->type,
    'label' => $this->label,
    'amount' => $this->amount,
    'percentage' => $this->percentage,
    'source_id' => $this->sourceId,
    'included' => $this->included,
    'locked' => $this->locked,
  ];
}