mirror of
https://0xacab.org/radar/radar-wp.git
synced 2025-04-30 11:16:31 +02:00
Upgrading to 1.0.0-beta1 version of the API PHP implementation.
This commit is contained in:
parent
4424f09f06
commit
4ed51243b5
56 changed files with 1330 additions and 824 deletions
|
@ -24,7 +24,9 @@ function radar_retrieve_events($settings) {
|
|||
$settings['fields'] = _radar_field_name_mapping($settings['fields']);
|
||||
$filter = radar_filter($settings);
|
||||
$request = $client->prepareEventsRequest($filter, $settings['fields'], $settings['max_count']);
|
||||
return $client->retrieve($request);
|
||||
$response = $client->retrieveResponse($request);
|
||||
$events = $client->parseResponse($response);
|
||||
return $events;
|
||||
}
|
||||
|
||||
function radar_retrieve_entities(array $entities) {
|
||||
|
@ -111,6 +113,10 @@ function _radar_field_name_mapping($fields) {
|
|||
function _radar_parse_items($type, $items, $fields, $subfields = array()) {
|
||||
$content = array();
|
||||
foreach ((array) $items as $item) {
|
||||
if (!is_object($item)) {
|
||||
error_log('_radar_parse_items called with empty item');
|
||||
continue;
|
||||
}
|
||||
$current_content = array();
|
||||
// Cycle through the fields in best order that we can.
|
||||
foreach ($fields as $field_name) {
|
||||
|
@ -131,7 +137,6 @@ function _radar_parse_items($type, $items, $fields, $subfields = array()) {
|
|||
}
|
||||
$content[] = $current_content;
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue