Я получил значение массива из API.
model\Quote Object
(
[quote_reference:protected] => 12345
[proposals:protected] => model\Proposals Object
(
[proposal:protected] => Array
(
[0] => model\Proposal Object
(
[id:protected] => prp_3453453453sdfsd
[fees_included:protected] => 1
[charged_amount:protected] => model\Amount Object
(
[currency:protected] => USD
[amount:protected] => 105.00
)
[credited_amount:protected] => model\Amount Object
(
[currency:protected] => MAD
[amount:protected] => 1000.00
)
[principal_amount:protected] => model\Amount Object
(
[currency:protected] => USD
[amount:protected] => 100.00
)
[expiration_date:protected] => DateTime Object
(
[date] => 2016-04-07 02:12:55.682000
[timezone_type] => 1
[timezone] => -05:00
)
[destination_service_tag:protected] =>
[corridor_tag:protected] =>
[resource_type:protected] => proposal
[additional_data_list:protected] => model\AdditionalDataList Object
(
[data:protected] => model\Data Object
(
[data_field:protected] => Array
(
[0] => model\DataField Object
(
[name:protected] => 811
[value:protected] => 123
)
[1] => model\DataField Object
(
[name:protected] => 851
[value:protected] => 456
)
)
)
[item_count:protected] => 2
[resource_type:protected] => list
)
[wholesale_fx_rate:protected] =>
)
[1] => model\Proposal Object
(
[id:protected] => prp_456sgdfgsdfg [fees_included:protected] => 1
[charged_amount:protected] => model\Amount Object
(
[currency:protected] => USD
[amount:protected] => 100.00
)
[credited_amount:protected] => model\Amount Object
(
[currency:protected] => MAD
[amount:protected] => 950.00
)
[principal_amount:protected] => model\Amount Object
(
[currency:protected] => USD
[amount:protected] => 100.00
)
[expiration_date:protected] => DateTime Object
(
[date] => 2016-04-07 02:22:55.682000
[timezone_type] => 1
[timezone] => -05:00
)
[destination_service_tag:protected] =>
[corridor_tag:protected] =>
[resource_type:protected] => proposal
[additional_data_list:protected] => model\AdditionalDataList Object
(
[data:protected] => model\Data Object
(
[data_field:protected] => Array
(
[0] => model\DataField Object
(
[name:protected] => 811
[value:protected] => 123
)
[1] => model\DataField Object
(
[name:protected] => 851
[value:protected] => 456
)
)
)
[item_count:protected] => 2
[resource_type:protected] => list
)
[wholesale_fx_rate:protected] =>
)
)
)
)
Мне нужно получить доступ к обоим proposal
значения массива в 0
а также 1
позиция индекса.
Я старался:
$arrayobject->proposals->proposal[0];
Получение ошибки:
Неустранимая ошибка: невозможно получить доступ к модели защищенного свойства \ Quote :: $ offer
Любая идея или помощь будут оценены.
Спасибо!
Задача ещё не решена.
Других решений пока нет …