10 public function convert(array $locationRawData,
int $descendantType)
14 if(isset($locationRawData[
'result'][
'address_components'])
15 && is_array($locationRawData[
'result'][
'address_components'])
16 && count($locationRawData[
'result'][
'address_components']) > 0
19 $items = array_reverse($locationRawData[
'result'][
'address_components']);
22 foreach ($items as $item)
24 $types =$this->
convertTypes($item[
'types'], $descendantType);
31 if($accumulator <>
'')
36 $accumulator .= $item[
'long_name'];
39 'NAME' => $accumulator,
45 return array_reverse($result);