Browse Source

Refactor: rename get_sql to getSql

Maurits van der Schee 8 years ago
parent
commit
8c9c052513
1 changed files with 9 additions and 9 deletions
  1. 9
    9
      api.php

+ 9
- 9
api.php View File

1
 <?php
1
 <?php
2
 interface DatabaseInterface {
2
 interface DatabaseInterface {
3
-	public function get_sql($name);
3
+	public function getSql($name);
4
 	public function connectDatabase($hostname,$username,$password,$database,$port,$socket,$charset);
4
 	public function connectDatabase($hostname,$username,$password,$database,$port,$socket,$charset);
5
 	public function query($sql,$params);
5
 	public function query($sql,$params);
6
 	public function fetch_assoc($result);
6
 	public function fetch_assoc($result);
77
 		);
77
 		);
78
 	}
78
 	}
79
 
79
 
80
-	public function get_sql($name) {
80
+	public function getSql($name) {
81
 		return isset($this->queries[$name])?$this->queries[$name]:false;
81
 		return isset($this->queries[$name])?$this->queries[$name]:false;
82
 	}
82
 	}
83
 
83
 
239
 		);
239
 		);
240
 	}
240
 	}
241
 
241
 
242
-	public function get_sql($name) {
242
+	public function getSql($name) {
243
 		return isset($this->queries[$name])?$this->queries[$name]:false;
243
 		return isset($this->queries[$name])?$this->queries[$name]:false;
244
 	}
244
 	}
245
 
245
 
429
 		);
429
 		);
430
 	}
430
 	}
431
 
431
 
432
-	public function get_sql($name) {
432
+	public function getSql($name) {
433
 		return isset($this->queries[$name])?$this->queries[$name]:false;
433
 		return isset($this->queries[$name])?$this->queries[$name]:false;
434
 	}
434
 	}
435
 
435
 
676
 		$table_array = explode(',',$tables);
676
 		$table_array = explode(',',$tables);
677
 		$table_list = array();
677
 		$table_list = array();
678
 		foreach ($table_array as $table) {
678
 		foreach ($table_array as $table) {
679
-			if ($result = $this->db->query($this->db->get_sql('reflect_table'),array($table,$database))) {
679
+			if ($result = $this->db->query($this->db->getSql('reflect_table'),array($table,$database))) {
680
 				while ($row = $this->db->fetch_row($result)) $table_list[] = $row[0];
680
 				while ($row = $this->db->fetch_row($result)) $table_list[] = $row[0];
681
 				$this->db->close($result);
681
 				$this->db->close($result);
682
 				if ($action!='list') break;
682
 				if ($action!='list') break;
739
 		if (!$key) return false;
739
 		if (!$key) return false;
740
 		$count = 0;
740
 		$count = 0;
741
 		$field = false;
741
 		$field = false;
742
-		if ($result = $this->db->query($this->db->get_sql('reflect_pk'),array($tables[0],$database))) {
742
+		if ($result = $this->db->query($this->db->getSql('reflect_pk'),array($tables[0],$database))) {
743
 			while ($row = $this->db->fetch_row($result)) {
743
 			while ($row = $this->db->fetch_row($result)) {
744
 				$count++;
744
 				$count++;
745
 				$field = $row[0];
745
 				$field = $row[0];
880
 			$table0 = array_shift($tables);
880
 			$table0 = array_shift($tables);
881
 			$tableset[] = $table0;
881
 			$tableset[] = $table0;
882
 
882
 
883
-			$result = $this->db->query($this->db->get_sql('reflect_belongs_to'),array($table0,$tables,$database,$database));
883
+			$result = $this->db->query($this->db->getSql('reflect_belongs_to'),array($table0,$tables,$database,$database));
884
 			while ($row = $this->db->fetch_row($result)) {
884
 			while ($row = $this->db->fetch_row($result)) {
885
 				$collect[$row[0]][$row[1]]=array();
885
 				$collect[$row[0]][$row[1]]=array();
886
 				$select[$row[2]][$row[3]]=array($row[0],$row[1]);
886
 				$select[$row[2]][$row[3]]=array($row[0],$row[1]);
887
 				if (!in_array($row[0],$tableset)) $tableset[] = $row[0];
887
 				if (!in_array($row[0],$tableset)) $tableset[] = $row[0];
888
 			}
888
 			}
889
-			$result = $this->db->query($this->db->get_sql('reflect_has_many'),array($tables,$table0,$database,$database));
889
+			$result = $this->db->query($this->db->getSql('reflect_has_many'),array($tables,$table0,$database,$database));
890
 			while ($row = $this->db->fetch_row($result)) {
890
 			while ($row = $this->db->fetch_row($result)) {
891
 				$collect[$row[2]][$row[3]]=array();
891
 				$collect[$row[2]][$row[3]]=array();
892
 				$select[$row[0]][$row[1]]=array($row[2],$row[3]);
892
 				$select[$row[0]][$row[1]]=array($row[2],$row[3]);
893
 				if (!in_array($row[2],$tableset)) $tableset[] = $row[2];
893
 				if (!in_array($row[2],$tableset)) $tableset[] = $row[2];
894
 			}
894
 			}
895
-			$result = $this->db->query($this->db->get_sql('reflect_habtm'),array($database,$database,$database,$database,$table0,$tables));
895
+			$result = $this->db->query($this->db->getSql('reflect_habtm'),array($database,$database,$database,$database,$table0,$tables));
896
 			while ($row = $this->db->fetch_row($result)) {
896
 			while ($row = $this->db->fetch_row($result)) {
897
 				$collect[$row[2]][$row[3]]=array();
897
 				$collect[$row[2]][$row[3]]=array();
898
 				$select[$row[0]][$row[1]]=array($row[2],$row[3]);
898
 				$select[$row[0]][$row[1]]=array($row[2],$row[3]);

Loading…
Cancel
Save