protected function keyUnitsById() {
    $keyed_units = array();
    foreach ($this->units as $unit) {
      $keyed_units[$unit->getUnitId()] = $unit;
    }

    return $keyed_units;
  }
protected function keyUnitsById() {
    $keyed_units = array();
    foreach ($this->units as $unit) {
      $keyed_units[$unit->getUnitId()] = $unit;
    }

    return $keyed_units;
  }
protected function keyUnitsById ( ) { $ keyed_units = array ( ) ; foreach ( $ this -> units as $ unit ) { $ keyed_units [ $ unit -> getUnitId ( ) ] = $ unit ; } return $ keyed_units ; }
Return an array of units keyed by unit id

@return array
Return an array of units keyed by unit id