You are here

public function Currency::toArray in Currency 8.3

Gets an array of all property values.

Return value

mixed[] An array of property values, keyed by property name.

Overrides ConfigEntityBase::toArray

File

src/Entity/Currency.php, line 435

Class

Currency
Defines a currency entity class.

Namespace

Drupal\currency\Entity

Code

public function toArray() {
  $properties = parent::toArray();
  $properties['usages'] = [];
  foreach ($this
    ->getUsages() as $usage) {
    $properties['usages'][] = array(
      'start' => $usage
        ->getStart(),
      'end' => $usage
        ->getEnd(),
      'countryCode' => $usage
        ->getCountryCode(),
    );
  }
  return $properties;
}