Стандартный код такой:
if (!is_null(Core_Array::getGet('ajaxLoad')))
{
$aObjects = array();
if (Core_Array::getGet('shop_country_id'))
{
$oShop_Country_Location = Core_Entity::factory('Shop_Country_Location');
$oShop_Country_Location
->queryBuilder()
->where('shop_country_id', '=', intval(Core_Array::getGet('shop_country_id')));
$aObjects = $oShop_Country_Location->getAllByActive(1);
}
elseif (Core_Array::getGet('shop_country_location_id'))
{
$oShop_Country_Location_City = Core_Entity::factory('Shop_Country_Location_City');
$oShop_Country_Location_City
->queryBuilder()
->where('shop_country_location_id', '=', intval(Core_Array::getGet('shop_country_location_id')));
$aObjects = $oShop_Country_Location_City->getAllByActive(1);
}
elseif (Core_Array::getGet('shop_country_location_city_id'))
{
$oShop_Country_Location_City_Area = Core_Entity::factory('Shop_Country_Location_City_Area');
$oShop_Country_Location_City_Area
->queryBuilder()
->where('shop_country_location_city_id', '=', intval(Core_Array::getGet('shop_country_location_city_id')));
$aObjects = $oShop_Country_Location_City_Area->getAllByActive(1);
}
$aArray = array('…');
foreach ($aObjects as $Object)
{
//$aArray['_' . $Object->id] = $Object->name;
$aArray['_' . $Object->id] = $Object->getName();
}
Core::showJson($aArray);
}