projects
/
mtweb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b914776
)
auto crud pour XML
mtweb.0.11.1
author
dj3c1t
<dj3c1t@free.fr>
Tue, 29 Oct 2013 19:10:47 +0000
(20:10 +0100)
committer
dj3c1t
<dj3c1t@free.fr>
Tue, 29 Oct 2013 19:10:47 +0000
(20:10 +0100)
mw/app/data/modules/share/mw_data_auto_crud.php
patch
|
blob
|
history
diff --git
a/mw/app/data/modules/share/mw_data_auto_crud.php
b/mw/app/data/modules/share/mw_data_auto_crud.php
index
59a7cc0
..
2e72ebc
100644
(file)
--- a/
mw/app/data/modules/share/mw_data_auto_crud.php
+++ b/
mw/app/data/modules/share/mw_data_auto_crud.php
@@
-5,11
+5,16
@@
function call_data_auto_crud($method_name, $arguments){
$r = false;
$sgbd = $this->sgbd();
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))
// 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(
){
$r = $this->data_desc(
array(
@@
-21,7
+26,7
@@
if(
(substr($method_name, 0, 4) == "add_")
&& ($table_name = substr($method_name, 4))
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(
){
$r = $this->data_insert(
array(
@@
-34,7
+39,7
@@
elseif(
(substr($method_name, 0, 4) == "get_")
&& ($table_name = substr($method_name, 4))
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(
){
$r = $this->data_read(
array(
@@
-48,7
+53,7
@@
elseif(
(substr($method_name, 0, 5) == "list_")
&& ($table_name = substr($method_name, 5))
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;
){
$params = $arguments[0];
$params["table_name"] = $table_name;
@@
-58,7
+63,7
@@
elseif(
(substr($method_name, 0, 4) == "set_")
&& ($table_name = substr($method_name, 4))
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(
){
$r = $this->data_update(
array(
@@
-73,7
+78,7
@@
elseif(
(substr($method_name, 0, 4) == "del_")
&& ($table_name = substr($method_name, 4))
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(
){
$r = $this->data_delete(
array(