3 class mw_env_data extends mw_env{
7 function set_data(&$data){
12 return isset($this->data) ? $this->data : false;
17 class mw_data extends empty_class{
19 function call_default($inst, $method_name, $arguments){
20 return $this->call_data_auto_crud($method_name, $arguments);
30 function mw_sgbd($sgbd_impl, $env){
31 $this->sgbd_impl = $sgbd_impl;
35 function extention_ok(){
36 return $this->sgbd_impl->extention_ok($this->env);
39 function authentication_required(){
40 return $this->sgbd_impl->authentication_required();
43 function connect($host, $base, $user, $password){
44 return $this->sgbd_impl->connect($host, $base, $user, $password);
47 function select_db($db_name){
48 return $this->sgbd_impl->select_db($db_name);
51 # ---------------------------------------------------------------------------------
55 function desc_table($table_name){
56 if(!method_exists($this->sgbd_impl, "desc_table")) return false;
57 return $this->sgbd_impl->desc_table(
58 ($prefix_codes = array_keys($this->env->bdd("table_prefix"))) ?
59 str_replace($prefix_codes, array_values($this->env->bdd("table_prefix")), $table_name)
64 function table_exists($table_name){
65 if(!method_exists($this->sgbd_impl, "table_exists")) return false;
66 return $this->sgbd_impl->table_exists(
67 ($prefix_codes = array_keys($this->env->bdd("table_prefix"))) ?
68 str_replace($prefix_codes, array_values($this->env->bdd("table_prefix")), $table_name)
73 function field_exists($table_name, $field_name){
74 if(!method_exists($this->sgbd_impl, "field_exists")) return false;
75 return $this->sgbd_impl->field_exists(
77 $prefix_codes = array_keys($this->env->bdd("table_prefix"))) ?
78 str_replace($prefix_codes, array_values($this->env->bdd("table_prefix")), $table_name)
85 if(!method_exists($this->sgbd_impl, "query")) return false;
86 return $this->sgbd_impl->query(
87 ($prefix_codes = array_keys($this->env->bdd("table_prefix"))) ?
88 str_replace($prefix_codes, array_values($this->env->bdd("table_prefix")), $sql)
94 if(!method_exists($this->sgbd_impl, "insert_id")) return false;
95 return $this->sgbd_impl->insert_id();
98 function fetch_assoc($rst){
99 if(!method_exists($this->sgbd_impl, "fetch_assoc")) return false;
100 return $this->sgbd_impl->fetch_assoc($rst);
103 function free_result($rst){
104 if(!method_exists($this->sgbd_impl, "")) return false;
105 return $this->sgbd_impl->free_result($rst);
109 if(!method_exists($this->sgbd_impl, "")) return false;
110 return $this->sgbd_impl->close();
113 # ---------------------------------------------------------------------------------
117 function data_exists($data_path){
118 if(!method_exists($this->sgbd_impl, "data_exists")) return false;
119 return $this->sgbd_impl->data_exists($data_path);
122 function create_data($data_path){
123 if(!method_exists($this->sgbd_impl, "create_data")) return false;
124 return $this->sgbd_impl->create_data($data_path);
127 function get_data($data_path, $data_id){
128 if(!method_exists($this->sgbd_impl, "get_data")) return false;
129 return $this->sgbd_impl->get_data($data_path, $data_id);
132 function open_data($data_path, $FETCH = true){
133 if(!method_exists($this->sgbd_impl, "open_data")) return false;
134 return $this->sgbd_impl->open_data($data_path, $FETCH);
137 function fetch_data($dh){
138 if(!method_exists($this->sgbd_impl, "fetch_data")) return false;
139 return $this->sgbd_impl->fetch_data($dh);
142 function add_data($data_path, $data, $index = null){
143 if(!method_exists($this->sgbd_impl, "add_data")) return false;
144 return $this->sgbd_impl->add_data($data_path, $data, $index);
147 function last_index($dh){
148 if(!method_exists($this->sgbd_impl, "last_index")) return false;
149 return $this->sgbd_impl->last_index($dh);
152 function set_data($data_path, $data_id, $data){
153 if(!method_exists($this->sgbd_impl, "set_data")) return false;
154 return $this->sgbd_impl->set_data($data_path, $data_id, $data);
157 function del_data($data_path, $data_id){
158 if(!method_exists($this->sgbd_impl, "del_data")) return false;
159 return $this->sgbd_impl->del_data($data_path, $data_id);
162 function close_data($dh){
163 if(!method_exists($this->sgbd_impl, "close_data")) return false;
164 return $this->sgbd_impl->close_data($dh);
167 function remove_data($data_path){
168 if(!method_exists($this->sgbd_impl, "remove_data")) return false;
169 return $this->sgbd_impl->remove_data($data_path);