Есть класс, нужно из него получить
cacheKey. Подскажите как это сделать
class API extends Expedia
{
public function getHotelList($params)
{
$result = array();
try {
$hotels = $this->list($params);
if ($hotels != null && isset($hotels['HotelList'])) {
$this->_totalHotels = $hotels['HotelList']['@activePropertyCount'];
}
while ($hotels != null) {
if (isset($hotels['HotelList'])) {
if ($hotels['HotelList']['@size'] > 1) {
$result = array_merge($result, $hotels['HotelList']['HotelSummary']);
} else {
$result = array_merge($result, array($hotels['HotelList']['HotelSummary']));
}
}
if (!$hotels['moreResultsAvailable']) {
break;
}
if (isset($params['numberOfResults']) && count($result) <= intval($params['numberOfResults'])) {
break;
}
$hotels = $this->list(array(
'cacheKey' => $hotels['cacheKey'],
'cacheLocation' => $hotels['cacheLocation']
));
}
} catch (Exception $ex) {
$data = $ex->getData();
if ($data['category'] != 'RESULT_NULL') {
throw new Exception($data);
}
}
$this->_availableHotels = count($result);
return $result;
}
}