Created
July 10, 2017 23:47
-
-
Save davidpede/a3cff92bf44dfd821499bc8f0c7b68b2 to your computer and use it in GitHub Desktop.
Add custom json data to modObjectGetListProcessor
This file contains hidden or 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
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