Move AJAX stuff into a base class and inheriting from it
authorJoey Schulze <joey@infodrom.org>
Sun, 17 Jul 2016 09:33:53 +0000 (11:33 +0200)
committerJoey Schulze <joey@infodrom.org>
Sun, 17 Jul 2016 09:34:11 +0000 (11:34 +0200)
class/ajaxbackend.class.php
class/ajaxbackendbase.class.php [new file with mode: 0644]

index 53c9d92..234974b 100644 (file)
@@ -1,14 +1,6 @@
 <?php
 
-class AJAXBackend {
-  private $db;
-
-  public function __construct__()
-  {
-    global $db;
-    $this->db = $db;
-  }
-
+class AJAXBackend extends AJAXBackendBase {
   public function salesText()
   {
     $sales = new Sales($_POST['id']);
@@ -16,4 +8,3 @@ class AJAXBackend {
   }
 }
 
-?>
\ No newline at end of file
diff --git a/class/ajaxbackendbase.class.php b/class/ajaxbackendbase.class.php
new file mode 100644 (file)
index 0000000..e8f2723
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+
+class AJAXBackendBase {
+  protected $db;
+
+  public function __construct__()
+  {
+    global $db;
+    $this->db = $db;
+  }
+
+}