Beispiel #1
0
 public function run()
 {
     $connection = new \Achat\PdoConnection();
     $history = new \Achat\ChatHistory($connection);
     $renderer = new \Achat\Renderer\Json();
     return $renderer->render(array("success" => true, "entries" => $history->findRecent()));
 }
Beispiel #2
0
 public function run($message)
 {
     $connection = new \Achat\PdoConnection();
     $history = new \Achat\ChatHistory($connection);
     $result = $history->addMessage($message);
     $renderer = new \Achat\Renderer\Json();
     return $renderer->render(array("success" => (bool) $result));
 }