Skip to content

Commit

Permalink
Lib: Enhanced DoQuery response for lusers
Browse files Browse the repository at this point in the history
lusers in API_DoQuery responses were not being normalized. Mirrored
functionality found in node-quickbase
  • Loading branch information
tflanagan committed Oct 28, 2015
1 parent c1f4792 commit 0a76890
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions quickbase.php
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,19 @@ final public static function API_DoQuery(&$query, &$results){
);
}
}

if(isset($results['table']['lusers'])){
if(isset($results['table']['lusers']['_'])){
$results['table']['lusers'] = array( $results['table']['lusers'] );
}

for($i = 0, $l = count($results['table']['lusers']); $i < $l; ++$i){
$results['table']['lusers'][$i] = array(
'name' => $results['table']['lusers'][$i]['_'],
'id' => $results['table']['lusers'][$i]['id']
);
}
}
}else{
if(isset($results['record'])){
$results['records'] = $results['record'];
Expand Down

0 comments on commit 0a76890

Please sign in to comment.