| Conditions | 6 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | protected function guessRegion($address) |
||
| 30 | { |
||
| 31 | if ($address |
||
| 32 | && $address->getCountry() && $address->getRegionText() |
||
| 33 | && !$address->getRegion() |
||
| 34 | ) { |
||
| 35 | $region = $this->doctrineHelper |
||
| 36 | ->getEntityRepository('OroAddressBundle:Region') |
||
| 37 | ->findOneBy( |
||
| 38 | [ |
||
| 39 | 'country' => $address->getCountry(), |
||
| 40 | 'name' => $address->getRegionText() |
||
| 41 | ] |
||
| 42 | ); |
||
| 43 | if ($region) { |
||
| 44 | $address->setRegion($region); |
||
| 45 | $address->setRegionText(null); |
||
| 46 | } |
||
| 47 | } |
||
| 48 | } |
||
| 49 | } |
||
| 50 |