@@ -87,7 +87,7 @@ |
||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | return $classname . ' {' . implode(', ', array_map( |
| 90 | - function ($p_0) use ($data) { |
|
| 90 | + function($p_0) use ($data) { |
|
| 91 | 91 | $p_0->setAccessible(true); |
| 92 | 92 | |
| 93 | 93 | return $p_0->getName() . ': ' . $p_0->getValue($data); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public function select(string $fields = '*', string $add = '', array $values = null, bool $returnModel = false, bool $debug = false) |
| 29 | 29 | {
|
| 30 | - if (strlen($add) > 0) {
|
|
| 30 | + if (strlen($add)>0) {
|
|
| 31 | 31 | $add = ' ' . $add; |
| 32 | 32 | } |
| 33 | 33 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $numparams = substr($numparams, 1); |
| 67 | 67 | $sql = "INSERT INTO {$this->getTable()} ({$fields}) VALUES ({$numparams})";
|
| 68 | 68 | if ($debug) {
|
| 69 | - echo $sql.'<pre>'.print_r($values).'</pre>'; |
|
| 69 | + echo $sql . '<pre>' . print_r($values) . '</pre>'; |
|
| 70 | 70 | return; |
| 71 | 71 | } |
| 72 | 72 | $result = $this->executeSQL($sql, $values); |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $sql .= " WHERE $where"; |
| 149 | 149 | } |
| 150 | 150 | if ($debug) {
|
| 151 | - echo $sql.'<pre>'.print_r($values).'</pre>'; |
|
| 151 | + echo $sql . '<pre>' . print_r($values) . '</pre>'; |
|
| 152 | 152 | return; |
| 153 | 153 | } |
| 154 | 154 | $result = $this->executeSQL($sql, $values); |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $sql .= " WHERE $where"; |
| 224 | 224 | } |
| 225 | 225 | if ($debug) {
|
| 226 | - echo $sql.'<pre>'.print_r($values).'</pre>'; |
|
| 226 | + echo $sql . '<pre>' . print_r($values) . '</pre>'; |
|
| 227 | 227 | return; |
| 228 | 228 | } |
| 229 | 229 | $result = $this->executeSQL($sql, $values); |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | protected function orderBy(string $parameter, $order = null): self |
| 187 | 187 | {
|
| 188 | 188 | try {
|
| 189 | - $query = "ORDER BY {$parameter} ".($order ?? 'ASC');
|
|
| 189 | + $query = "ORDER BY {$parameter} " . ($order ?? 'ASC');
|
|
| 190 | 190 | $this->add($query, "orderBy"); |
| 191 | 191 | return $this; |
| 192 | 192 | } catch (\PDOException $e) {
|
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | protected function addOrderBy(string $parameter, $order = null): self |
| 198 | 198 | {
|
| 199 | 199 | try {
|
| 200 | - $query = ", {$parameter} ".($order ?? 'ASC')." ";
|
|
| 200 | + $query = ", {$parameter} " . ($order ?? 'ASC') . " ";
|
|
| 201 | 201 | $this->add($query, "addOrderBy"); |
| 202 | 202 | return $this; |
| 203 | 203 | } catch (\PDOException $e) {
|
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | protected function limit(string $texto): self |
| 213 | 213 | {
|
| 214 | 214 | $query = "LIMIT {$texto}";
|
| 215 | - $this->add($query,"limit"); |
|
| 215 | + $this->add($query, "limit"); |
|
| 216 | 216 | return $this; |
| 217 | 217 | } |
| 218 | 218 | |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | {
|
| 225 | 225 | try {
|
| 226 | 226 | $query = "OFFSET {$texto}";
|
| 227 | - $this->add($query,"offset"); |
|
| 227 | + $this->add($query, "offset"); |
|
| 228 | 228 | return $this; |
| 229 | 229 | } catch (\PDOException $e) {
|
| 230 | 230 | $this->setError($e); |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | {
|
| 240 | 240 | try {
|
| 241 | 241 | $query = "GROUP BY {$texto}";
|
| 242 | - $this->add($query,"groupBy"); |
|
| 242 | + $this->add($query, "groupBy"); |
|
| 243 | 243 | return $this; |
| 244 | 244 | } catch (\PDOException $e) {
|
| 245 | 245 | $this->setError($e); |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | {
|
| 255 | 255 | try {
|
| 256 | 256 | $query = "HAVING {$texto}";
|
| 257 | - $this->add($query,"having"); |
|
| 257 | + $this->add($query, "having"); |
|
| 258 | 258 | return $this; |
| 259 | 259 | } catch (\PDOException $e) {
|
| 260 | 260 | $this->setError($e); |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | {
|
| 270 | 270 | try {
|
| 271 | 271 | $query = "AND {$texto}";
|
| 272 | - $this->add($query,"andHaving"); |
|
| 272 | + $this->add($query, "andHaving"); |
|
| 273 | 273 | return $this; |
| 274 | 274 | } catch (\PDOException $e) {
|
| 275 | 275 | $this->setError($e); |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | {
|
| 285 | 285 | try {
|
| 286 | 286 | $query = "OR {$codition}";
|
| 287 | - $this->add($query,"orHaving"); |
|
| 287 | + $this->add($query, "orHaving"); |
|
| 288 | 288 | return $this; |
| 289 | 289 | } catch (\PDOException $e) {
|
| 290 | 290 | $this->setError($e); |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | {
|
| 302 | 302 | try {
|
| 303 | 303 | $query = "INNER JOIN {$table} AS {$alias} ON $codition";
|
| 304 | - $this->add($query,"join"); |
|
| 304 | + $this->add($query, "join"); |
|
| 305 | 305 | return $this; |
| 306 | 306 | } catch (\PDOException $e) {
|
| 307 | 307 | $this->setError($e); |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | {
|
| 319 | 319 | try {
|
| 320 | 320 | $query = "LEFT JOIN {$table} AS {$alias} ON {$codition}";
|
| 321 | - $this->add($query,"join"); |
|
| 321 | + $this->add($query, "join"); |
|
| 322 | 322 | return $this; |
| 323 | 323 | } catch (\PDOException $e) {
|
| 324 | 324 | $this->setError($e); |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | {
|
| 336 | 336 | try {
|
| 337 | 337 | $query = "RIGHT JOIN {$table} AS {$alias} ON $codition";
|
| 338 | - $this->add($query,"join"); |
|
| 338 | + $this->add($query, "join"); |
|
| 339 | 339 | return $this; |
| 340 | 340 | } catch (\PDOException $e) {
|
| 341 | 341 | $this->setError($e); |
@@ -348,9 +348,9 @@ discard block |
||
| 348 | 348 | protected function executeQuery(): self |
| 349 | 349 | {
|
| 350 | 350 | try {
|
| 351 | - foreach ($this->sqlPartsSelect as $key => $part){
|
|
| 351 | + foreach ($this->sqlPartsSelect as $key => $part) {
|
|
| 352 | 352 | if (is_array($part)) {
|
| 353 | - foreach ($part as $item){
|
|
| 353 | + foreach ($part as $item) {
|
|
| 354 | 354 | $this->query .= $item; |
| 355 | 355 | } |
| 356 | 356 | } else {
|
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | */ |
| 422 | 422 | private function add(string $query, string $type, array $params = []): void |
| 423 | 423 | {
|
| 424 | - $query = $query." "; |
|
| 424 | + $query = $query . " "; |
|
| 425 | 425 | try {
|
| 426 | 426 | if (is_array($this->sqlPartsSelect[$type])) {
|
| 427 | 427 | $this->sqlPartsSelect[$type][] = $query; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | try { |
| 75 | 75 | if (strpos($_SERVER['SERVER_NAME'], mb_strtolower(CONFIG_DATA_LAYER["homologation"])) && !strpos($this->getDatabase(), ucfirst(CONFIG_DATA_LAYER["homologation"]))) { |
| 76 | - $database = $this->getDatabase().ucfirst(CONFIG_DATA_LAYER["homologation"] ?? ""); |
|
| 76 | + $database = $this->getDatabase() . ucfirst(CONFIG_DATA_LAYER["homologation"] ?? ""); |
|
| 77 | 77 | $this->setDatabase($database); |
| 78 | 78 | } |
| 79 | 79 | |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | $prepare = empty($prepare) ? $this->getPrepare() : $prepare; |
| 226 | 226 | return $prepare->rowCount(); |
| 227 | 227 | } catch (PDOException $e) { |
| 228 | - $this->setError($e);} |
|
| 228 | + $this->setError($e); } |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | /** |