You are here

public function Price::toArray in Price 3.0.x

Same name and namespace in other branches
  1. 8 src/Price.php \Drupal\price\Price::toArray()
  2. 3.x src/Price.php \Drupal\price\Price::toArray()
  3. 2.0.x src/Price.php \Drupal\price\Price::toArray()
  4. 2.x src/Price.php \Drupal\price\Price::toArray()

Gets the array representation of the price.

Return value

array The array representation of the price.

File

src/Price.php, line 80

Class

Price
Provides a value object for monetary values.

Namespace

Drupal\price

Code

public function toArray() {
  return [
    'number' => $this->number,
    'currency_code' => $this->currencyCode,
  ];
}