| Conditions | 2 |
| Paths | 2 |
| Total Lines | 24 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 19 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 4 | public function mapArrayToEntity(array $attributes) |
|
| 33 | { |
||
| 34 | 4 | $region = new RegionEntity(); |
|
| 35 | 4 | $region->setCode($attributes['code']); |
|
| 36 | 4 | $region->setLongCode($attributes['long_code']); |
|
| 37 | 4 | $region->setType($attributes['type']); |
|
| 38 | 4 | $region->setUnmappedCountry($attributes['country']); |
|
| 39 | 4 | $region->setTimezone($attributes['timezone']); |
|
| 40 | 4 | $region->setLatitude($attributes['latitude']); |
|
| 41 | 4 | $region->setLongitude($attributes['longitude']); |
|
| 42 | 4 | $region->setNorth($attributes['north']); |
|
| 43 | 4 | $region->setEast($attributes['east']); |
|
| 44 | 4 | $region->setSouth($attributes['south']); |
|
| 45 | 4 | $region->setWest($attributes['west']); |
|
| 46 | |||
| 47 | 4 | foreach ($attributes['names'] as $language => $name) { |
|
| 48 | 4 | $regionName = new RegionNameEntity(); |
|
| 49 | 4 | $regionName->setLanguage($language); |
|
| 50 | 4 | $regionName->setName($name); |
|
| 51 | 4 | $region->getNames()->add($regionName); |
|
| 52 | } |
||
| 53 | |||
| 54 | 4 | return $region; |
|
| 55 | } |
||
| 56 | } |
||
| 57 |