@@ -65,7 +65,7 @@ |
||
| 65 | 65 | $pos = strpos($sql, $needle); |
| 66 | 66 | if ($pos !== false) { |
| 67 | 67 | if (gettype($replace) === "string") { |
| 68 | - $replace = ' "'.addslashes($replace).'" '; |
|
| 68 | + $replace = ' "'.addslashes($replace).'" '; |
|
| 69 | 69 | } |
| 70 | 70 | $sql = substr_replace($sql, $replace, $pos, strlen($needle)); |
| 71 | 71 | } |
@@ -14,14 +14,14 @@ discard block |
||
| 14 | 14 | { |
| 15 | 15 | self::$classes[] = $ModelOfTable; |
| 16 | 16 | $currentISchemaTables = 0; |
| 17 | - if(array_key_exists("tables",self::$information_schema)){ |
|
| 17 | + if (array_key_exists("tables", self::$information_schema)) { |
|
| 18 | 18 | $currentISchemaTables = count(self::$information_schema["tables"]); |
| 19 | 19 | } else { |
| 20 | 20 | self::$information_schema["tables"] = []; |
| 21 | 21 | } |
| 22 | 22 | self::$information_schema["tables"][$currentISchemaTables]["Model"] = $ModelOfTable; |
| 23 | 23 | self::$information_schema["tables"][$currentISchemaTables]["TABLE_NAME"] = $ModelOfTable::getTableName(); |
| 24 | - self::$information_schema["tables"][$currentISchemaTables]["TABLE_SCHEMA"] = \Config::get('database.connections.'.\Config::get('database.default').'.database'); |
|
| 24 | + self::$information_schema["tables"][$currentISchemaTables]["TABLE_SCHEMA"] = \Config::get('database.connections.' . \Config::get('database.default') . '.database'); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | protected $normalizer; |
@@ -48,24 +48,24 @@ discard block |
||
| 48 | 48 | { |
| 49 | 49 | |
| 50 | 50 | //dd(self::$information_schema); |
| 51 | -dd(self::getSQL($query,$bindings)); |
|
| 51 | +dd(self::getSQL($query, $bindings)); |
|
| 52 | 52 | $records = parent::select($query, $bindings); |
| 53 | 53 | dd($records); |
| 54 | 54 | return $records; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - private function ProcessSQL($query,$results){ |
|
| 57 | + private function ProcessSQL($query, $results) { |
|
| 58 | 58 | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | private static function getSQL($sql, $bindings) |
| 62 | 62 | { |
| 63 | 63 | $needle = '?'; |
| 64 | - foreach ($bindings as $replace){ |
|
| 64 | + foreach ($bindings as $replace) { |
|
| 65 | 65 | $pos = strpos($sql, $needle); |
| 66 | 66 | if ($pos !== false) { |
| 67 | 67 | if (gettype($replace) === "string") { |
| 68 | - $replace = ' "'.addslashes($replace).'" '; |
|
| 68 | + $replace = ' "' . addslashes($replace) . '" '; |
|
| 69 | 69 | } |
| 70 | 70 | $sql = substr_replace($sql, $replace, $pos, strlen($needle)); |
| 71 | 71 | } |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | { |
| 15 | 15 | self::$classes[] = $ModelOfTable; |
| 16 | 16 | $currentISchemaTables = 0; |
| 17 | - if(array_key_exists("tables",self::$information_schema)){ |
|
| 17 | + if(array_key_exists("tables",self::$information_schema)) { |
|
| 18 | 18 | $currentISchemaTables = count(self::$information_schema["tables"]); |
| 19 | 19 | } else { |
| 20 | 20 | self::$information_schema["tables"] = []; |
@@ -54,14 +54,15 @@ discard block |
||
| 54 | 54 | return $records; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - private function ProcessSQL($query,$results){ |
|
| 57 | + private function ProcessSQL($query,$results) |
|
| 58 | + { |
|
| 58 | 59 | |
| 59 | 60 | } |
| 60 | 61 | |
| 61 | 62 | private static function getSQL($sql, $bindings) |
| 62 | 63 | { |
| 63 | 64 | $needle = '?'; |
| 64 | - foreach ($bindings as $replace){ |
|
| 65 | + foreach ($bindings as $replace) { |
|
| 65 | 66 | $pos = strpos($sql, $needle); |
| 66 | 67 | if ($pos !== false) { |
| 67 | 68 | if (gettype($replace) === "string") { |