public function getProducts() { # code... $pid = new getproduct(); $post = json_decode(Flight::request()->getBody()); DuoWorldCommon::mapToObject($post, $pid); $client = ObjectStoreClient::WithNamespace(DuoWorldCommon::GetHost(), "Products", "123"); $respond = $client->get()->byKey($post->productId); echo json_encode($respond); }
public function addRecord($obj) { $client = ObjectStoreClient::WithNamespace(DuoWorldCommon::GetHost(), "Ledger", "123"); $respond = $client->store()->byKeyField("InvoiceNumber")->andStore($obj); return $respond; }
public static function WithNamespace($ns, $cls, $token) { $c = new ObjectStoreClient(); $c->setNamespace($ns); $c->setClass($cls); $c->setToken($token); return $c; }
public function getAllGroups() { $client = ObjectStoreClient::WithNamespace(DuoWorldCommon::GetHost(), "UserGroup", "123"); $respond = $client->get()->all(); echo json_encode($respond); }