@@ -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 | { |
@@ -14,7 +14,6 @@ |
||
| 14 | 14 | use Laztopaz\potatoORM\NoRecordFoundException; |
| 15 | 15 | use Laztopaz\potatoORM\NoRecordInsertionException; |
| 16 | 16 | use Laztopaz\potatoORM\NullArgumentPassedToFunction; |
| 17 | -use Laztopaz\potatoORM\WrongArgumentException; |
|
| 18 | 17 | use Laztopaz\potatoORM\NoArgumentPassedToFunctionException; |
| 19 | 18 | use Laztopaz\potatoORM\EmptyArrayException; |
| 20 | 19 | |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | namespace Laztopaz\potatoORM; |
| 10 | 10 | |
| 11 | 11 | use PDO; |
| 12 | -use Laztopaz\potatoORM\DatabaseHelper; |
|
| 13 | 12 | use Laztopaz\potatoORM\TableFieldUndefinedException; |
| 14 | 13 | use Laztopaz\potatoORM\EmptyArrayException; |
| 15 | 14 | |
@@ -21,6 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * This is a constructor; a default method that will be called automatically during class instantiation |
| 24 | + * @param string|false $modelClassName |
|
| 24 | 25 | */ |
| 25 | 26 | public function __construct($modelClassName, $dbConn = Null) |
| 26 | 27 | { |
@@ -35,7 +36,8 @@ discard block |
||
| 35 | 36 | /** |
| 36 | 37 | * This method create a record and store it in a table row |
| 37 | 38 | * @params associative array, string tablename |
| 38 | - * @return boolean true or false |
|
| 39 | + * @param string|false $tableName |
|
| 40 | + * @return boolean|null true or false |
|
| 39 | 41 | */ |
| 40 | 42 | public function create($associative1DArray, $tableName, $dbConn = Null) |
| 41 | 43 | { |
@@ -72,6 +74,10 @@ discard block |
||
| 72 | 74 | * @params: $updateParams, $tableName, $associative1DArray |
| 73 | 75 | * @return boolean true or false |
| 74 | 76 | */ |
| 77 | + |
|
| 78 | + /** |
|
| 79 | + * @param string|false $tableName |
|
| 80 | + */ |
|
| 75 | 81 | public function update(array $updateParams, $tableName, $associative1DArray, $dbConn = Null) |
| 76 | 82 | { |
| 77 | 83 | $sql = ""; |
@@ -102,6 +108,7 @@ discard block |
||
| 102 | 108 | /** |
| 103 | 109 | * This method retrieves record from a table |
| 104 | 110 | * @params int id, string tableName |
| 111 | + * @param string|false $tableName |
|
| 105 | 112 | * @return array |
| 106 | 113 | */ |
| 107 | 114 | public static function read($id, $tableName, $dbConn = Null) |
@@ -132,6 +139,7 @@ discard block |
||
| 132 | 139 | /** |
| 133 | 140 | * This method deletes a record from a table row |
| 134 | 141 | * @params int id, string tableName |
| 142 | + * @param string|false $tableName |
|
| 135 | 143 | * @return boolean true or false |
| 136 | 144 | */ |
| 137 | 145 | public static function delete($id, $tableName, $dbConn = Null) |
@@ -164,7 +172,7 @@ discard block |
||
| 164 | 172 | |
| 165 | 173 | /** |
| 166 | 174 | * This method returns sql query |
| 167 | - * @param $sql |
|
| 175 | + * @param string $sql |
|
| 168 | 176 | * @return string |
| 169 | 177 | */ |
| 170 | 178 | public function prepareUpdateQuery($sql) |
@@ -206,6 +214,7 @@ discard block |
||
| 206 | 214 | * This method returns column fields of a particular table |
| 207 | 215 | * @param $table |
| 208 | 216 | * @param $conn |
| 217 | + * @param DatabaseConnection $dbConn |
|
| 209 | 218 | * @return array |
| 210 | 219 | */ |
| 211 | 220 | public function getColumnNames($table, $dbConn = Null) { |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | |
| 9 | 9 | namespace Laztopaz\potatoORM; |
| 10 | 10 | |
| 11 | -use PDO; |
|
| 12 | 11 | use Laztopaz\potatoORM\TableNotCreatedException; |
| 13 | 12 | |
| 14 | 13 | class DatabaseHelper { |