Created
July 18, 2014 18:12
-
-
Save tjtate/3b59137e6668eaeefd0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
private function getGoogleData($customerIDDim, $customerNumber, $value) { | |
$params = array( | |
'metrics' => $value[1], | |
'dimensions' => $value[0], | |
'filters' => $customerIDDim.'=='.$customerNumber, | |
); | |
$results = $this->googleAuth->_query($params); | |
$reformated = array(); | |
if (isset($results['rows'])) { | |
foreach ($results['rows'] as $key => $valuez) { | |
array_pop($valuez); | |
$finalarray = array(); | |
foreach ($valuez as $newkey => $newvalue) { | |
$finalarray[$value[2][$newkey]] = $newvalue; | |
} | |
array_push ($reformated, $finalarray); | |
} | |
return $reformated; | |
} | |
else { | |
return $results['totalsForAllResults']; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment