//In this case remove password on User table before return the data ArrestDBConfig::postProcess(["table" => "User", "method" => ["GET", "GET_INTERNAL"]], function ($method, $table, $id, $data) { if (isset($data[0])) { foreach ($data as $k => $item) { unset($item["password"]); } } else { unset($data["password"]); } return $data; }); //In this case when a new user is created, it's inserted ArrestDBConfig::postProcess(["method" => "POST", "table" => "User"], function ($method, $table, $id, $data) { if (isset($_GET["Group_id"])) { $group_id = $_GET["Group_id"]; ArrestDB::query("INSERT INTO UserInGroup(Group_id,User_id) VALUES ({$group_id},{$id})"); } return $data; }); /** CALL function (optional) Allows to call a function to do complex operations. All functions use POST method. Remember this when you'll call it. function ($func,$data) - $func: function name - $data: values in $_POST variable */ //In this case ArrestDBConfig::fnc("sendMsg", function ($func, $data) { return sendMsg($data);
], function($method,$table,$id,$data){ if (isset($data[0])) foreach ($data as $k=>$item) unset($item["password"]); else unset($data["password"]); return $data; }); */ //In this case when a new UserInfo is created when User is created ArrestDBConfig::postProcess(["method" => "POST", "table" => "user"], function ($method, $table, $id, $data) { if (isset($_GET["Name"])) { $name = $_GET["Name"]; ArrestDB::query("INSERT INTO UserInfo(Name,User_id) VALUES ({$name},{$id})"); } return $data; }); /** CALL function (optional) Allows to call a function to do complex operations. All functions use POST method. Remember this when you'll call it. function ($func,$data) - $func: function name - $data: values in $_POST variable Example ------------ - version() api function returns string "Beta 1"