function call_data_auto_crud($method_name, $arguments){
$r = false;
$sgbd = $this->sgbd();
+
+ $env = $this->env();
+ $IS_XML = $env->bdd("sgbd") == "xml";
+ $table_exists_function = $IS_XML ? "data_exists" : "table_exists";
+
// desc_<table_name>()
if(
(substr($method_name, 0, 5) == "desc_")
&& ($table_name = substr($method_name, 5))
- && ($sgbd->table_exists("#--".$table_name))
+ && ($sgbd->$table_exists_function(($IS_XML ? "" : "#--").$table_name))
){
$r = $this->data_desc(
array(
if(
(substr($method_name, 0, 4) == "add_")
&& ($table_name = substr($method_name, 4))
- && ($sgbd->table_exists("#--".$table_name))
+ && ($sgbd->$table_exists_function(($IS_XML ? "" : "#--").$table_name))
){
$r = $this->data_insert(
array(
elseif(
(substr($method_name, 0, 4) == "get_")
&& ($table_name = substr($method_name, 4))
- && ($sgbd->table_exists("#--".$table_name))
+ && ($sgbd->$table_exists_function(($IS_XML ? "" : "#--").$table_name))
){
$r = $this->data_read(
array(
elseif(
(substr($method_name, 0, 5) == "list_")
&& ($table_name = substr($method_name, 5))
- && ($sgbd->table_exists("#--".$table_name))
+ && ($sgbd->$table_exists_function(($IS_XML ? "" : "#--").$table_name))
){
$params = $arguments[0];
$params["table_name"] = $table_name;
elseif(
(substr($method_name, 0, 4) == "set_")
&& ($table_name = substr($method_name, 4))
- && ($sgbd->table_exists("#--".$table_name))
+ && ($sgbd->$table_exists_function(($IS_XML ? "" : "#--").$table_name))
){
$r = $this->data_update(
array(
elseif(
(substr($method_name, 0, 4) == "del_")
&& ($table_name = substr($method_name, 4))
- && ($sgbd->table_exists("#--".$table_name))
+ && ($sgbd->$table_exists_function(($IS_XML ? "" : "#--").$table_name))
){
$r = $this->data_delete(
array(