@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | /** |
| 120 | 120 | * This method find a record by id |
| 121 | 121 | * @params int id |
| 122 | - * @return Object |
|
| 122 | + * @return BaseClass |
|
| 123 | 123 | * @throws NoArgumentPassedToFunctionException |
| 124 | 124 | */ |
| 125 | 125 | public static function find($id) |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | /** |
| 172 | 172 | * This method return the current class name |
| 173 | 173 | * $params void |
| 174 | - * @return classname |
|
| 174 | + * @return string|false |
|
| 175 | 175 | */ |
| 176 | 176 | public static function getClassName() |
| 177 | 177 | { |
@@ -15,9 +15,9 @@ discard block |
||
| 15 | 15 | class DatabaseConnection extends \PDO |
| 16 | 16 | { |
| 17 | 17 | private $databaseName; |
| 18 | - private $databaseHost; |
|
| 18 | + private $databaseHost; |
|
| 19 | 19 | private $databaseDriver; |
| 20 | - private $databaseUsername; |
|
| 20 | + private $databaseUsername; |
|
| 21 | 21 | private $databasePassword; |
| 22 | 22 | private $databaseHandle; |
| 23 | 23 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | //$dotenv = new Dotenv($_SERVER['DOCUMENT_ROOT']); |
| 106 | 106 | $dotenv = new Dotenv(__DIR__.'/../../'); |
| 107 | - $dotenv->load(); |
|
| 107 | + $dotenv->load(); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | } |
@@ -22,6 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * This is a constructor; a default method that will be called automatically during class instantiation |
| 25 | + * @param string|false $modelClassName |
|
| 25 | 26 | */ |
| 26 | 27 | public function __construct($modelClassName, $dbConn = Null) |
| 27 | 28 | { |
@@ -40,6 +41,7 @@ discard block |
||
| 40 | 41 | /** |
| 41 | 42 | * This method create a record and store it in a table row |
| 42 | 43 | * @params associative array, string tablename |
| 44 | + * @param string|false $tableName |
|
| 43 | 45 | * @return boolean true or false |
| 44 | 46 | */ |
| 45 | 47 | public function create($associative1DArray, $tableName, $dbConn = Null) |
@@ -81,6 +83,10 @@ discard block |
||
| 81 | 83 | * @params: $updateParams, $tableName, $associative1DArray |
| 82 | 84 | * @return boolean true or false |
| 83 | 85 | */ |
| 86 | + |
|
| 87 | + /** |
|
| 88 | + * @param string|false $tableName |
|
| 89 | + */ |
|
| 84 | 90 | public function update(array $updateParams, $tableName, $associative1DArray, $dbConn = Null) |
| 85 | 91 | { |
| 86 | 92 | $sql = ""; |
@@ -124,6 +130,7 @@ discard block |
||
| 124 | 130 | /** |
| 125 | 131 | * This method retrieves record from a table |
| 126 | 132 | * @params int id, string tableName |
| 133 | + * @param string|false $tableName |
|
| 127 | 134 | * @return array |
| 128 | 135 | */ |
| 129 | 136 | public static function read($id, $tableName, $dbConn = Null) |
@@ -161,6 +168,7 @@ discard block |
||
| 161 | 168 | /** |
| 162 | 169 | * This method deletes a record from a table row |
| 163 | 170 | * @params int id, string tableName |
| 171 | + * @param string|false $tableName |
|
| 164 | 172 | * @return boolean true or false |
| 165 | 173 | */ |
| 166 | 174 | public static function delete($id, $tableName, $dbConn = Null) |
@@ -201,7 +209,7 @@ discard block |
||
| 201 | 209 | |
| 202 | 210 | /** |
| 203 | 211 | * This method returns sql query |
| 204 | - * @param $sql |
|
| 212 | + * @param string $sql |
|
| 205 | 213 | * @return string |
| 206 | 214 | */ |
| 207 | 215 | private function prepareUpdateQuery($sql) |
@@ -254,6 +262,7 @@ discard block |
||
| 254 | 262 | * This method returns column fields of a particular table |
| 255 | 263 | * @param $table |
| 256 | 264 | * @param $conn |
| 265 | + * @param DatabaseConnection $dbConn |
|
| 257 | 266 | * @return array |
| 258 | 267 | */ |
| 259 | 268 | public function getColumnNames($table, $dbConn = Null){ |