@@ -25,8 +25,8 @@ |
||
| 25 | 25 | self::$connect = new \PDO($dsn, self::$user, self::$pass, $options); |
| 26 | 26 | self::$connect->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); |
| 27 | 27 | |
| 28 | - } catch (\PDOException $e) { |
|
| 29 | - echo $e->getMessage() ."in ".$e->getFile(); |
|
| 28 | + }catch (\PDOException $e) { |
|
| 29 | + echo $e->getMessage()."in ".$e->getFile(); |
|
| 30 | 30 | |
| 31 | 31 | } |
| 32 | 32 | return self::$connect; |
@@ -33,12 +33,12 @@ |
||
| 33 | 33 | |
| 34 | 34 | $this->delete = "DELETE FROM {$this->table} {$this->terms}"; |
| 35 | 35 | |
| 36 | - try{ |
|
| 36 | + try { |
|
| 37 | 37 | $this->result = DB::connect()->prepare($this->delete); |
| 38 | 38 | $this->result->execute($this->statements); |
| 39 | 39 | $this->error = true; |
| 40 | 40 | |
| 41 | - }catch (\PDOException $e){ |
|
| 41 | + }catch (\PDOException $e) { |
|
| 42 | 42 | echo $e->getMessage(); |
| 43 | 43 | |
| 44 | 44 | } |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | $this->result->execute($this->statements); |
| 39 | 39 | $this->error = true; |
| 40 | 40 | |
| 41 | - }catch (\PDOException $e){ |
|
| 41 | + } catch (\PDOException $e){ |
|
| 42 | 42 | echo $e->getMessage(); |
| 43 | 43 | |
| 44 | 44 | } |
@@ -49,14 +49,14 @@ |
||
| 49 | 49 | $places = ':'.implode(', :', array_keys($this->data)); |
| 50 | 50 | $this->create = "INSERT INTO {$this->table} ({$fields}) VALUES ({$places})"; |
| 51 | 51 | |
| 52 | - try{ |
|
| 52 | + try { |
|
| 53 | 53 | |
| 54 | 54 | $this->statements = DB::connect()->prepare($this->create); |
| 55 | 55 | $this->statements->execute($this->data); |
| 56 | 56 | $this->result = DB::connect()->lastInsertId(); |
| 57 | 57 | $this->error = true; |
| 58 | 58 | |
| 59 | - }catch (\PDOException $e){ |
|
| 59 | + }catch (\PDOException $e) { |
|
| 60 | 60 | echo $e->getMessage(); |
| 61 | 61 | |
| 62 | 62 | } |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | $this->result = DB::connect()->lastInsertId(); |
| 57 | 57 | $this->error = true; |
| 58 | 58 | |
| 59 | - }catch (\PDOException $e){ |
|
| 59 | + } catch (\PDOException $e){ |
|
| 60 | 60 | echo $e->getMessage(); |
| 61 | 61 | |
| 62 | 62 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $this->data = $data; |
| 76 | 76 | parse_str($parse, $this->statements); |
| 77 | 77 | |
| 78 | - foreach ($data as $key => $value){ |
|
| 78 | + foreach ($data as $key => $value) { |
|
| 79 | 79 | $this->places[] = $key.' = :'.$key; |
| 80 | 80 | |
| 81 | 81 | } |
@@ -84,13 +84,13 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | $this->update = "UPDATE {$this->table} SET {$this->places} {$this->terms}"; |
| 86 | 86 | |
| 87 | - try{ |
|
| 87 | + try { |
|
| 88 | 88 | $this->result = DB::connect()->prepare($this->update); |
| 89 | 89 | $this->result->execute(array_merge($this->data, $this->statements)); |
| 90 | 90 | $this->error = true; |
| 91 | 91 | |
| 92 | 92 | |
| 93 | - }catch (\PDOException $e){ |
|
| 93 | + }catch (\PDOException $e) { |
|
| 94 | 94 | echo $e->getMessage(); |
| 95 | 95 | |
| 96 | 96 | } |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | $this->error = true; |
| 91 | 91 | |
| 92 | 92 | |
| 93 | - }catch (\PDOException $e){ |
|
| 93 | + } catch (\PDOException $e){ |
|
| 94 | 94 | echo $e->getMessage(); |
| 95 | 95 | |
| 96 | 96 | } |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | $this->read->execute($this->statement); |
| 160 | 160 | $this->rows = $this->read->rowCount(); |
| 161 | 161 | return $this->result = $this->read->fetchAll(\PDO::FETCH_OBJ); |
| 162 | - } catch (\PDOException $e) { |
|
| 163 | - echo $e->getMessage() . " in " . $e->getFile(); |
|
| 162 | + }catch (\PDOException $e) { |
|
| 163 | + echo $e->getMessage()." in ".$e->getFile(); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | return $this; |
@@ -193,8 +193,8 @@ discard block |
||
| 193 | 193 | $this->result = $this->read->fetchAll(\PDO::FETCH_OBJ); |
| 194 | 194 | |
| 195 | 195 | |
| 196 | - } catch (\PDOException $e) { |
|
| 197 | - echo $e->getMessage() . " in " . $e->getFile(); |
|
| 196 | + }catch (\PDOException $e) { |
|
| 197 | + echo $e->getMessage()." in ".$e->getFile(); |
|
| 198 | 198 | |
| 199 | 199 | } |
| 200 | 200 | |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | public function render() |
| 205 | 205 | { |
| 206 | - for ($i = 1; $i <= $this->maxLinks; $i++){ |
|
| 206 | + for ($i = 1; $i <= $this->maxLinks; $i++) { |
|
| 207 | 207 | echo "<a href=\"?atual={$i}\" class=\"paginator\">{$i}</a>"; |
| 208 | 208 | |
| 209 | 209 | } |