@@ -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 | { |
@@ -12,8 +12,8 @@ |
||
| 12 | 12 | |
| 13 | 13 | class NoRecordDeletionException extends Exception |
| 14 | 14 | { |
| 15 | - public static function checkNoRecordUpdateException($message) |
|
| 16 | - { |
|
| 17 | - return new static($message); |
|
| 18 | - } |
|
| 15 | + public static function checkNoRecordUpdateException($message) |
|
| 16 | + { |
|
| 17 | + return new static($message); |
|
| 18 | + } |
|
| 19 | 19 | } |
@@ -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 | { |
@@ -36,7 +37,8 @@ discard block |
||
| 36 | 37 | /** |
| 37 | 38 | * This method create a record and store it in a table row |
| 38 | 39 | * @params associative array, string tablename |
| 39 | - * @return boolean true or false |
|
| 40 | + * @param string|false $tableName |
|
| 41 | + * @return boolean|null true or false |
|
| 40 | 42 | */ |
| 41 | 43 | public function create($associative1DArray, $tableName, $dbConn = Null) |
| 42 | 44 | { |
@@ -79,6 +81,10 @@ discard block |
||
| 79 | 81 | * @params: $updateParams, $tableName, $associative1DArray |
| 80 | 82 | * @return boolean true or false |
| 81 | 83 | */ |
| 84 | + |
|
| 85 | + /** |
|
| 86 | + * @param string|false $tableName |
|
| 87 | + */ |
|
| 82 | 88 | public function update(array $updateParams, $tableName, $associative1DArray, $dbConn = Null) |
| 83 | 89 | { |
| 84 | 90 | $sql = ""; |
@@ -112,6 +118,7 @@ discard block |
||
| 112 | 118 | /** |
| 113 | 119 | * This method retrieves record from a table |
| 114 | 120 | * @params int id, string tableName |
| 121 | + * @param string|false $tableName |
|
| 115 | 122 | * @return array |
| 116 | 123 | */ |
| 117 | 124 | public static function read($id, $tableName, $dbConn = Null) |
@@ -143,6 +150,7 @@ discard block |
||
| 143 | 150 | /** |
| 144 | 151 | * This method deletes a record from a table row |
| 145 | 152 | * @params int id, string tableName |
| 153 | + * @param string|false $tableName |
|
| 146 | 154 | * @return boolean true or false |
| 147 | 155 | */ |
| 148 | 156 | public static function delete($id, $tableName, $dbConn = Null) |
@@ -177,7 +185,7 @@ discard block |
||
| 177 | 185 | |
| 178 | 186 | /** |
| 179 | 187 | * This method returns sql query |
| 180 | - * @param $sql |
|
| 188 | + * @param string $sql |
|
| 181 | 189 | * @return string |
| 182 | 190 | */ |
| 183 | 191 | public function prepareUpdateQuery($sql) |
@@ -219,6 +227,7 @@ discard block |
||
| 219 | 227 | * This method returns column fields of a particular table |
| 220 | 228 | * @param $table |
| 221 | 229 | * @param $conn |
| 230 | + * @param DatabaseConnection $dbConn |
|
| 222 | 231 | * @return array |
| 223 | 232 | */ |
| 224 | 233 | public function getColumnNames($table, $dbConn = Null) { |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | public function __construct() |
| 23 | 23 | { |
| 24 | - $this->loadEnv(); // load the environment variables |
|
| 25 | - $this->databaseName = getenv('databaseName'); |
|
| 24 | + $this->loadEnv(); // load the environment variables |
|
| 25 | + $this->databaseName = getenv('databaseName'); |
|
| 26 | 26 | $this->databaseHost = getenv('databaseHost'); |
| 27 | 27 | $this->databaseDriver = getenv('databaseDriver'); |
| 28 | 28 | $this->databaseUsername = getenv('databaseUsername'); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | { |
| 79 | 79 | if (!getenv("APP_ENV")) { |
| 80 | 80 | $dotenv = new Dotenv(__DIR__.'/../../'); |
| 81 | - $dotenv->load(); |
|
| 81 | + $dotenv->load(); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | } |