Skip to content

Commit

Permalink
Comment filtering of results
Browse files Browse the repository at this point in the history
  • Loading branch information
rwhite27 committed Jan 9, 2020
1 parent a21506c commit 4ef8d2b
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/Zoho/CRM/Request/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,27 +177,27 @@ protected function parseResponseGetRecords()
foreach ($dataElement as $key => $value) {
$key = strpos($key, '_') ? str_replace('_', ' ', $key) : $key;

if (gettype($value) == 'array' && array_key_exists('id', $value)) {
if ($key == 'Owner') {
$key = 'Lead ' . $key;
$record['SMOWNERID'] = $value['id'];
$value = $value['name'];
} elseif ($key == 'Created By') {
$record['SMCREATORID'] = $value['id'];
$value = $value['name'];
} else {
$record[strtoupper(str_replace(' ', '', $key))] = $value['id'];
$value = $value['name'];
}
}

if (gettype($value) == 'array' && empty($value)) {
$value = '';
}

if ($key == 'id') {
$key = 'LEADID';
}
// if (gettype($value) == 'array' && array_key_exists('id', $value)) {
// if ($key == 'Owner') {
// $key = 'Lead ' . $key;
// $record['SMOWNERID'] = $value['id'];
// $value = $value['name'];
// } elseif ($key == 'Created By') {
// $record['SMCREATORID'] = $value['id'];
// $value = $value['name'];
// } else {
// $record[strtoupper(str_replace(' ', '', $key))] = $value['id'];
// $value = $value['name'];
// }
// }

// if (gettype($value) == 'array' && empty($value)) {
// $value = '';
// }

// if ($key == 'id') {
// $key = 'LEADID';
// }

$record[$key] = $value;
}
Expand Down

0 comments on commit 4ef8d2b

Please sign in to comment.