@@ -13,7 +13,6 @@ |
||
| 13 | 13 | use PDOException; |
| 14 | 14 | use Ibonly\PotatoORM\DatabaseQueryInterface; |
| 15 | 15 | use Ibonly\PotatoORM\ColumnNotExistExeption; |
| 16 | -use Ibonly\PotatoORM\InvalidConnectionException; |
|
| 17 | 16 | use Ibonly\PotatoORM\TableDoesNotExistException; |
| 18 | 17 | |
| 19 | 18 | class DatabaseQuery implements DatabaseQueryInterface |
@@ -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,9 @@ discard block |
||
| 226 | 228 | /** |
| 227 | 229 | * selectQuery |
| 228 | 230 | * |
| 231 | + * @param string $tableName |
|
| 232 | + * @param string $fields |
|
| 233 | + * @param string $connection |
|
| 229 | 234 | * @return string |
| 230 | 235 | */ |
| 231 | 236 | public static function selectQuery($tableName, $fields, $data, $condition, $connection) |
@@ -253,6 +258,7 @@ discard block |
||
| 253 | 258 | /** |
| 254 | 259 | * insertQuery |
| 255 | 260 | * |
| 261 | + * @param string $tableName |
|
| 256 | 262 | * @return string |
| 257 | 263 | */ |
| 258 | 264 | public function insertQuery($tableName) |
@@ -270,6 +276,7 @@ discard block |
||
| 270 | 276 | /** |
| 271 | 277 | * updateQuery |
| 272 | 278 | * |
| 279 | + * @param string $tableName |
|
| 273 | 280 | * @return string |
| 274 | 281 | */ |
| 275 | 282 | public function updateQuery($tableName) |
@@ -9,17 +9,12 @@ |
||
| 9 | 9 | |
| 10 | 10 | namespace Ibonly\PotatoORM; |
| 11 | 11 | |
| 12 | -use PDO; |
|
| 13 | -use Exception; |
|
| 14 | -use PDOException; |
|
| 15 | 12 | use Ibonly\PotatoORM\GetData; |
| 16 | 13 | use Ibonly\PotatoORM\DatabaseQuery; |
| 17 | 14 | use Ibonly\PotatoORM\ModelInterface; |
| 18 | 15 | use Ibonly\PotatoORM\UserNotFoundException; |
| 19 | 16 | use Ibonly\PotatoORM\EmptyDatabaseException; |
| 20 | 17 | use Ibonly\PotatoORM\SaveUserExistException; |
| 21 | -use Ibonly\PotatoORM\ColumnNotExistExeption; |
|
| 22 | -use Ibonly\PotatoORM\InvalidConnectionException; |
|
| 23 | 18 | |
| 24 | 19 | class Model extends DatabaseQuery implements ModelInterface |
| 25 | 20 | { |
@@ -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 | { |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | /** |
| 63 | 63 | *@method bool ValidateExtension() returns whether the extension of file to be uploaded |
| 64 | 64 | * is allowable or not. |
| 65 | - *@return true the extension is valid. |
|
| 66 | - *@return false the extension is invalid. |
|
| 65 | + *@return boolean the extension is valid. |
|
| 66 | + *@return boolean the extension is invalid. |
|
| 67 | 67 | */ |
| 68 | 68 | public function ValidateExtension() |
| 69 | 69 | { |
@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | /** |
| 97 | 97 | *@method bool ValidateSize() returns whether the file size is acceptable. |
| 98 | - *@return true the size is smaller than the alloted value. |
|
| 99 | - *@return false the size is larger than the alloted value. |
|
| 98 | + *@return boolean the size is smaller than the alloted value. |
|
| 99 | + *@return boolean the size is larger than the alloted value. |
|
| 100 | 100 | */ |
| 101 | 101 | public function ValidateSize() |
| 102 | 102 | { |
@@ -120,8 +120,8 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | /** |
| 122 | 122 | *@method bool ValidateExistance() determins whether the file already exists. If so, rename $FileName. |
| 123 | - *@return true can never be returned as all file names must be unique. |
|
| 124 | - *@return false the file name does not exist. |
|
| 123 | + *@return null|false can never be returned as all file names must be unique. |
|
| 124 | + *@return null|false the file name does not exist. |
|
| 125 | 125 | */ |
| 126 | 126 | public function ValidateExistance() |
| 127 | 127 | { |
@@ -142,8 +142,8 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | /** |
| 144 | 144 | *@method bool ValidateDirectory() |
| 145 | - *@return true the UploadDirectory exists, writable, and has a traling slash. |
|
| 146 | - *@return false the directory was never set, does not exist, or is not writable. |
|
| 145 | + *@return null|boolean the UploadDirectory exists, writable, and has a traling slash. |
|
| 146 | + *@return null|boolean the directory was never set, does not exist, or is not writable. |
|
| 147 | 147 | */ |
| 148 | 148 | public function ValidateDirectory() |
| 149 | 149 | { |
@@ -177,8 +177,8 @@ discard block |
||
| 177 | 177 | |
| 178 | 178 | /** |
| 179 | 179 | *@method bool ValidateImage() |
| 180 | - *@return true the image is smaller than the alloted dimensions. |
|
| 181 | - *@return false the width and/or height is larger then the alloted dimensions. |
|
| 180 | + *@return boolean the image is smaller than the alloted dimensions. |
|
| 181 | + *@return boolean the width and/or height is larger then the alloted dimensions. |
|
| 182 | 182 | */ |
| 183 | 183 | public function ValidateImage() { |
| 184 | 184 | $MaximumWidth = $this->MaximumWidth; |
@@ -206,8 +206,8 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | /** |
| 208 | 208 | *@method bool UploadFile() uploads the file to the server after passing all the validations. |
| 209 | - *@return true the file was uploaded. |
|
| 210 | - *@return false the upload failed. |
|
| 209 | + *@return null|boolean the file was uploaded. |
|
| 210 | + *@return null|boolean the upload failed. |
|
| 211 | 211 | */ |
| 212 | 212 | public function uploadFile() |
| 213 | 213 | { |
@@ -251,11 +251,18 @@ discard block |
||
| 251 | 251 | |
| 252 | 252 | #Accessors and Mutators beyond this point. |
| 253 | 253 | #Siginificant documentation is not needed. |
| 254 | + |
|
| 255 | + /** |
|
| 256 | + * @param string $argv |
|
| 257 | + */ |
|
| 254 | 258 | public function SetFileName($argv) |
| 255 | 259 | { |
| 256 | 260 | $this->FileName = $argv; |
| 257 | 261 | } |
| 258 | 262 | |
| 263 | + /** |
|
| 264 | + * @param string $argv |
|
| 265 | + */ |
|
| 259 | 266 | public function SetUploadDirectory($argv) |
| 260 | 267 | { |
| 261 | 268 | $this->UploadDirectory = $argv; |
@@ -310,6 +317,9 @@ discard block |
||
| 310 | 317 | return $this->UploadDirectory; |
| 311 | 318 | } |
| 312 | 319 | |
| 320 | + /** |
|
| 321 | + * @return string |
|
| 322 | + */ |
|
| 313 | 323 | public function GetTempName() |
| 314 | 324 | { |
| 315 | 325 | return $this->TempFileName; |