You are here

public function Price::toArray in Price 8

Same name and namespace in other branches
  1. 3.x src/Price.php \Drupal\price\Price::toArray()
  2. 2.0.x src/Price.php \Drupal\price\Price::toArray()
  3. 2.x src/Price.php \Drupal\price\Price::toArray()
  4. 3.0.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,
  ];
}