コード例 #1
0
ファイル: config_example.php プロジェクト: kabus202/ArrestDB
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);
});
コード例 #2
0
ファイル: easyConfig.php プロジェクト: aglahn/ArrestDB
 function ArrestDB_table_keyName($table)
 {
     return ArrestDBConfig::execute_keyname($table);
 }