syntaxe POO (visibilite) et maj indentation
[mw_sourceml] / app / data / modules / xml / sml_data_sources_cache_db.php
index 9700fdd..7496d6b 100644 (file)
@@ -1,18 +1,17 @@
 <?php
 
-  class sml_data_sources_cache_db extends mw_data
-  {
+  class sml_data_sources_cache_db extends mw_data{
 
-    function source_cache_db()
-    { $sgbd = $this->sgbd();
+    public function source_cache_db(){
+      $sgbd = $this->sgbd();
       $source_cache = array();
-      if($rst = $sgbd->open_data("sml_source_cache"))
-      { while($v_rst = $sgbd->fetch_data($rst))
-        { if(isset($v_rst))
-          { if(isset($v_rst["id"])) $source_cache[$v_rst["id"]] = $v_rst;
+      if($rst = $sgbd->open_data("sml_source_cache")){
+        while($v_rst = $sgbd->fetch_data($rst)){
+          if(isset($v_rst)){
+            if(isset($v_rst["id"])) $source_cache[$v_rst["id"]] = $v_rst;
           }
-          else
-          { $source_cache = false;
+          else{
+            $source_cache = false;
             $break;
           }
         }
       return $source_cache;
     }
 
-    function source_cache_infos_db($url)
-    { $sgbd = $this->sgbd();
+    public function source_cache_infos_db($url){
+      $sgbd = $this->sgbd();
       $cache_infos = array();
-      if($rst = $sgbd->open_data("sml_source_cache"))
-      { while($v_rst = $sgbd->fetch_data($rst))
-        { if(isset($v_rst))
-          { if(isset($v_rst["id"]) && isset($v_rst["url"]))
-            { if($v_rst["url"] == $url)
-              { $cache_infos = $v_rst;
+      if($rst = $sgbd->open_data("sml_source_cache")){
+        while($v_rst = $sgbd->fetch_data($rst)){
+          if(isset($v_rst)){
+            if(isset($v_rst["id"]) && isset($v_rst["url"])){
+              if($v_rst["url"] == $url){
+                $cache_infos = $v_rst;
                 $break;
               }
             }
           }
-          else
-          { $cache_infos = false;
+          else{
+            $cache_infos = false;
             $break;
           }
         }
       return $cache_infos;
     }
 
-    function add_source_cache_db($url, $cache_index)
-    { $sgbd = $this->sgbd();
-      return $sgbd->add_data
-      ( "sml_source_cache",
-        array
-        ( "url" => $url,
+    public function add_source_cache_db($url, $cache_index){
+      $sgbd = $this->sgbd();
+      return $sgbd->add_data(
+        "sml_source_cache",
+        array(
+          "url" => $url,
           "id_source" => $cache_index,
           "last_update" => date("Y-m-d H:i:s")
         )
       ) ? true : false;
     }
 
-    function del_source_cache_db($id_cache_data)
-    { $sgbd = $this->sgbd();
+    public function del_source_cache_db($id_cache_data){
+      $sgbd = $this->sgbd();
       return $sgbd->del_data("sml_source_cache", $id_cache_data) ? true : false;
     }
 
   }
-
-?>
\ No newline at end of file