Skip to content

Instantly share code, notes, and snippets.

@davidpede
Created July 10, 2017 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidpede/a3cff92bf44dfd821499bc8f0c7b68b2 to your computer and use it in GitHub Desktop.
Save davidpede/a3cff92bf44dfd821499bc8f0c7b68b2 to your computer and use it in GitHub Desktop.
Add custom json data to modObjectGetListProcessor
public function process() {
$beforeQuery = $this->beforeQuery();
if ($beforeQuery !== true) {
return $this->failure($beforeQuery);
}
$data = $this->getData();
$list = $this->iterate($data);
$datetime = new DateTime('Europe/London');
$curtime = $datetime->format('Y\-m\-d\ H:i:s');
$json = $this->outputArray($list,$data['total']);
$array = json_decode($json,true);
$array['curtime'] = $curtime;
$json = json_encode($array);
return $json;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment