function getFullDepartAirport($type) { //get country $countries = $this->getCountry(); //get parent destination $parents = $this->getParentDest(); //get destination $result = array(); foreach ($countries as $c) { $result[$c->country_name] = array(); foreach ($parents as $pr) { if ($pr->country_id == $c->id) { $result[$c->country_name][$pr->title] = $this->getDepartDestByParent($pr->id, $type); } } $result[$c->country_name] = TransportHelper::removeEmptyArray($result[$c->country_name]); } return $result; }