@@ -42,12 +42,10 @@ |
||
| 42 | 42 | if ($this->driver === 'pgsql' || $this->driver === 'postgres') |
| 43 | 43 | { |
| 44 | 44 | parent::__construct($this->pgsqlConnectionString()); |
| 45 | - } |
|
| 46 | - elseif ($this->driver === 'mysql') |
|
| 45 | + } elseif ($this->driver === 'mysql') |
|
| 47 | 46 | { |
| 48 | 47 | parent::__construct($this->mysqlConnectionString(), $this->user, $this->password); |
| 49 | - } |
|
| 50 | - elseif($this->driver === 'sqlite') |
|
| 48 | + } elseif($this->driver === 'sqlite') |
|
| 51 | 49 | { |
| 52 | 50 | parent::__construct($this->sqlitConnectionString()); |
| 53 | 51 | } |
@@ -136,8 +136,9 @@ discard block |
||
| 136 | 136 | { |
| 137 | 137 | $counter++; |
| 138 | 138 | $insertQuery .= self::sanitize($key); |
| 139 | - if( $arraySize > $counter ) |
|
| 140 | - $insertQuery .= ", "; |
|
| 139 | + if( $arraySize > $counter ) { |
|
| 140 | + $insertQuery .= ", "; |
|
| 141 | + } |
|
| 141 | 142 | } |
| 142 | 143 | return $insertQuery; |
| 143 | 144 | } |
@@ -159,8 +160,9 @@ discard block |
||
| 159 | 160 | { |
| 160 | 161 | $counter++; |
| 161 | 162 | $insertQuery .= "'".self::sanitize($value) ."'"; |
| 162 | - if( $arraySize > $counter ) |
|
| 163 | - $insertQuery .= ", "; |
|
| 163 | + if( $arraySize > $counter ) { |
|
| 164 | + $insertQuery .= ", "; |
|
| 165 | + } |
|
| 164 | 166 | } |
| 165 | 167 | return $insertQuery; |
| 166 | 168 | } |
@@ -240,8 +242,7 @@ discard block |
||
| 240 | 242 | if( $arraySize > 1 && $condition == NULL) |
| 241 | 243 | { |
| 242 | 244 | $query = "Please Supply the condition"; |
| 243 | - } |
|
| 244 | - else |
|
| 245 | + } else |
|
| 245 | 246 | { |
| 246 | 247 | $columnName = self::whereAndClause($tableName, $data, $condition); |
| 247 | 248 | $query = "SELECT * FROM $tableName WHERE $columnName"; |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * @param $tablename |
| 63 | 63 | * @param $con |
| 64 | 64 | * |
| 65 | - * @return bool |
|
| 65 | + * @return boolean|null |
|
| 66 | 66 | */ |
| 67 | 67 | public function checkTableExist($table, $con=NULL) |
| 68 | 68 | { |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | /** |
| 78 | 78 | * checkTableName Return the table name |
| 79 | 79 | * |
| 80 | - * @param $tablename |
|
| 80 | + * @param string|false $tablename |
|
| 81 | 81 | * @param $con |
| 82 | 82 | * |
| 83 | 83 | * @return string |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | * checkColumn Check if column exist in table |
| 99 | 99 | * |
| 100 | 100 | * @param $tableName |
| 101 | - * @param $columnName |
|
| 101 | + * @param string $columnName |
|
| 102 | 102 | * @param $con |
| 103 | 103 | * |
| 104 | 104 | * @return string |
@@ -191,6 +191,8 @@ discard block |
||
| 191 | 191 | /** |
| 192 | 192 | * selectAllQuery |
| 193 | 193 | * |
| 194 | + * @param string $tableName |
|
| 195 | + * @param string $field |
|
| 194 | 196 | * @return string |
| 195 | 197 | */ |
| 196 | 198 | public static function selectAllQuery($tableName, $field) |
@@ -226,6 +228,8 @@ discard block |
||
| 226 | 228 | /** |
| 227 | 229 | * selectQuery |
| 228 | 230 | * |
| 231 | + * @param string $tableName |
|
| 232 | + * @param string $connection |
|
| 229 | 233 | * @return string |
| 230 | 234 | */ |
| 231 | 235 | public static function selectQuery($tableName, $data, $condition, $connection) |
@@ -253,6 +257,7 @@ discard block |
||
| 253 | 257 | /** |
| 254 | 258 | * insertQuery |
| 255 | 259 | * |
| 260 | + * @param string $tableName |
|
| 256 | 261 | * @return string |
| 257 | 262 | */ |
| 258 | 263 | public function insertQuery($tableName) |
@@ -270,6 +275,7 @@ discard block |
||
| 270 | 275 | /** |
| 271 | 276 | * updateQuery |
| 272 | 277 | * |
| 278 | + * @param string $tableName |
|
| 273 | 279 | * @return string |
| 274 | 280 | */ |
| 275 | 281 | public function updateQuery($tableName) |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | { |
| 30 | 30 | if(is_null($length)){ |
| 31 | 31 | $this->fieldDescription[] = $type ." ".$fieldName; |
| 32 | - }else |
|
| 32 | + } else |
|
| 33 | 33 | { |
| 34 | 34 | $this->fieldDescription[] = $type ." ".$fieldName." ".$length; |
| 35 | 35 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | if(sizeof($e) == 2) |
| 53 | 53 | { |
| 54 | 54 | $query .= $this->$e[0]($e[1], 20) .", ".PHP_EOL; |
| 55 | - }else |
|
| 55 | + } else |
|
| 56 | 56 | { |
| 57 | 57 | $query .= $this->$e[0]($e[1], $e[2]) .", ".PHP_EOL; |
| 58 | 58 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | { |
| 95 | 95 | return true; |
| 96 | 96 | } |
| 97 | - }catch(PDOException $e){ |
|
| 97 | + } catch(PDOException $e){ |
|
| 98 | 98 | return $e->getMessage(); |
| 99 | 99 | } |
| 100 | 100 | } |
@@ -51,6 +51,7 @@ discard block |
||
| 51 | 51 | /** |
| 52 | 52 | * getTableName() |
| 53 | 53 | * |
| 54 | + * @param string $connection |
|
| 54 | 55 | * @return string |
| 55 | 56 | */ |
| 56 | 57 | public static function getTableName($connection) |
@@ -62,7 +63,7 @@ discard block |
||
| 62 | 63 | * getALL() |
| 63 | 64 | * Get all record from the database |
| 64 | 65 | * |
| 65 | - * @return object |
|
| 66 | + * @return GetData |
|
| 66 | 67 | */ |
| 67 | 68 | public function getALL($dbConnection = NULL) |
| 68 | 69 | { |
@@ -82,7 +83,7 @@ discard block |
||
| 82 | 83 | * where($data, $condition) |
| 83 | 84 | * Get data from database where $data = $condition |
| 84 | 85 | * |
| 85 | - * @return object |
|
| 86 | + * @return GetData |
|
| 86 | 87 | */ |
| 87 | 88 | public function where($data, $condition = NULL, $dbConnection = NULL) |
| 88 | 89 | { |
@@ -103,7 +104,7 @@ discard block |
||
| 103 | 104 | * find($value) |
| 104 | 105 | * Find data from database where id = $value |
| 105 | 106 | * |
| 106 | - * @return array |
|
| 107 | + * @return Model |
|
| 107 | 108 | */ |
| 108 | 109 | public static function find($value, $dbConnection = NULL) |
| 109 | 110 | { |