@@ -133,11 +133,11 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - /** |
|
| 137 | - * Reset the form validation instance |
|
| 138 | - * |
|
| 139 | - * @return object the current instance |
|
| 140 | - */ |
|
| 136 | + /** |
|
| 137 | + * Reset the form validation instance |
|
| 138 | + * |
|
| 139 | + * @return object the current instance |
|
| 140 | + */ |
|
| 141 | 141 | public function reset() { |
| 142 | 142 | $this->rules = array(); |
| 143 | 143 | $this->labels = array(); |
@@ -160,11 +160,11 @@ discard block |
||
| 160 | 160 | return $this; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - /** |
|
| 164 | - * Return the validation data |
|
| 165 | - * |
|
| 166 | - * @return array the validation data |
|
| 167 | - */ |
|
| 163 | + /** |
|
| 164 | + * Return the validation data |
|
| 165 | + * |
|
| 166 | + * @return array the validation data |
|
| 167 | + */ |
|
| 168 | 168 | public function getData() { |
| 169 | 169 | return $this->data; |
| 170 | 170 | } |
@@ -213,11 +213,11 @@ discard block |
||
| 213 | 213 | return $this->rules; |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | - /** |
|
| 217 | - * Return the list of the validations rules for the given field |
|
| 218 | - * |
|
| 219 | - * @return array |
|
| 220 | - */ |
|
| 216 | + /** |
|
| 217 | + * Return the list of the validations rules for the given field |
|
| 218 | + * |
|
| 219 | + * @return array |
|
| 220 | + */ |
|
| 221 | 221 | public function getFieldRules($field) { |
| 222 | 222 | $rules = array(); |
| 223 | 223 | if (array_key_exists($field, $this->rules)) { |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | * @return string|null |
| 234 | 234 | */ |
| 235 | 235 | public function getFieldValue($field) { |
| 236 | - $value = null; |
|
| 236 | + $value = null; |
|
| 237 | 237 | if (array_key_exists($field, $this->data)) { |
| 238 | 238 | $value = $this->data[$field]; |
| 239 | 239 | } |
@@ -255,15 +255,15 @@ discard block |
||
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | |
| 258 | - /** |
|
| 259 | - * Return the list of validation errors |
|
| 260 | - * |
|
| 261 | - * @return array the errors list. |
|
| 262 | - * Format: |
|
| 263 | - * [field1] => 'error message 1', |
|
| 264 | - * [field2] => 'error message 2' |
|
| 265 | - */ |
|
| 266 | - public function getErrors() { |
|
| 258 | + /** |
|
| 259 | + * Return the list of validation errors |
|
| 260 | + * |
|
| 261 | + * @return array the errors list. |
|
| 262 | + * Format: |
|
| 263 | + * [field1] => 'error message 1', |
|
| 264 | + * [field2] => 'error message 2' |
|
| 265 | + */ |
|
| 266 | + public function getErrors() { |
|
| 267 | 267 | return $this->errors; |
| 268 | 268 | } |
| 269 | 269 | |
@@ -346,11 +346,11 @@ discard block |
||
| 346 | 346 | return $this; |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | - /** |
|
| 350 | - * Set the database instance using get_instance() if is null |
|
| 351 | - * |
|
| 352 | - * @return object the current instance |
|
| 353 | - */ |
|
| 349 | + /** |
|
| 350 | + * Set the database instance using get_instance() if is null |
|
| 351 | + * |
|
| 352 | + * @return object the current instance |
|
| 353 | + */ |
|
| 354 | 354 | protected function setDatabaseFromSuperInstanceIfNotSet() { |
| 355 | 355 | if (!is_object($this->database)) { |
| 356 | 356 | $this->database = get_instance()->database; |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | * @param string|null $field2 the second field used in some validation rule like "matches", "not_equal" |
| 388 | 388 | * |
| 389 | 389 | */ |
| 390 | - protected function setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue = null, $field2 = null) { |
|
| 390 | + protected function setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue = null, $field2 = null) { |
|
| 391 | 391 | //if the field is not required and his value is not set don't set error |
| 392 | 392 | //but in case the field have value validate it |
| 393 | 393 | if (!$this->fieldIsRequired($field) && strlen($value) <= 0) { |
@@ -413,9 +413,9 @@ discard block |
||
| 413 | 413 | * @return string the name of the validation method |
| 414 | 414 | */ |
| 415 | 415 | protected function getRuleValidationMethod($rule) { |
| 416 | - $parts = explode('_', $rule); |
|
| 417 | - $parts = array_map('ucfirst', $parts); |
|
| 418 | - return 'checkRule' . implode('', $parts); |
|
| 416 | + $parts = explode('_', $rule); |
|
| 417 | + $parts = array_map('ucfirst', $parts); |
|
| 418 | + return 'checkRule' . implode('', $parts); |
|
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | /** |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | protected function filterValidationData() { |
| 427 | 427 | foreach ($this->data as $key => $value ) { |
| 428 | 428 | if (is_array($value)) { |
| 429 | - $this->data[$key] = array_map('trim', $value); |
|
| 429 | + $this->data[$key] = array_map('trim', $value); |
|
| 430 | 430 | } else { |
| 431 | 431 | $this->data[$key] = trim($value); |
| 432 | 432 | } |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | $template['field2}'] = $field2; |
| 474 | 474 | $template['{value2}'] = $this->getFieldValue($field2); |
| 475 | 475 | $template['{label2}'] = $this->getFieldLabel($field2); |
| 476 | - } |
|
| 476 | + } |
|
| 477 | 477 | $message = $this->messages[$rule]; |
| 478 | 478 | //Check for custom message |
| 479 | 479 | if (isset($this->customErrors[$field][$rule])) { |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | //Get the name of the method to validate this rule |
| 505 | 505 | $method = $this->getRuleValidationMethod($realRuleName); |
| 506 | 506 | if (method_exists($this, $method)) { |
| 507 | - call_user_func_array(array($this, $method), array($field, $realRuleName, $paramValue)); |
|
| 507 | + call_user_func_array(array($this, $method), array($field, $realRuleName, $paramValue)); |
|
| 508 | 508 | } else { |
| 509 | 509 | $this->forceError = true; |
| 510 | 510 | show_error('Invalid validaton rule "' . $realRuleName . '"'); |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | * @param string|null $paramValue the rule parameter |
| 598 | 598 | */ |
| 599 | 599 | protected function checkRuleMinLength($field, $rule, $paramValue) { |
| 600 | - $value = $this->getFieldValue($field); |
|
| 600 | + $value = $this->getFieldValue($field); |
|
| 601 | 601 | if (strlen($value) < $paramValue) { |
| 602 | 602 | $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
| 603 | 603 | } |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | * @param string|null $paramValue the rule parameter |
| 612 | 612 | */ |
| 613 | 613 | protected function checkRuleMaxLength($field, $rule, $paramValue) { |
| 614 | - $value = $this->getFieldValue($field); |
|
| 614 | + $value = $this->getFieldValue($field); |
|
| 615 | 615 | if (strlen($value) > $paramValue) { |
| 616 | 616 | $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
| 617 | 617 | } |
@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | * @param string|null $paramValue the rule parameter |
| 626 | 626 | */ |
| 627 | 627 | protected function checkRuleExactLength($field, $rule, $paramValue) { |
| 628 | - $value = $this->getFieldValue($field); |
|
| 628 | + $value = $this->getFieldValue($field); |
|
| 629 | 629 | if (strlen($value) != $paramValue) { |
| 630 | 630 | $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
| 631 | 631 | } |
@@ -732,7 +732,7 @@ discard block |
||
| 732 | 732 | protected function checkRuleNumeric($field, $rule, $paramValue) { |
| 733 | 733 | $value = $this->getFieldValue($field); |
| 734 | 734 | if (!is_numeric($value)) { |
| 735 | - $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
|
| 735 | + $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
|
| 736 | 736 | } |
| 737 | 737 | } |
| 738 | 738 | |
@@ -746,7 +746,7 @@ discard block |
||
| 746 | 746 | protected function checkRuleInteger($field, $rule, $paramValue) { |
| 747 | 747 | $value = $this->getFieldValue($field); |
| 748 | 748 | if (filter_var($value, FILTER_VALIDATE_INT) === false) { |
| 749 | - $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
|
| 749 | + $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
|
| 750 | 750 | } |
| 751 | 751 | } |
| 752 | 752 | |
@@ -760,7 +760,7 @@ discard block |
||
| 760 | 760 | protected function checkRuleIntegerNatural($field, $rule, $paramValue) { |
| 761 | 761 | $value = $this->getFieldValue($field); |
| 762 | 762 | if (filter_var($value, FILTER_VALIDATE_INT) === false || $value < 0) { |
| 763 | - $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
|
| 763 | + $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
|
| 764 | 764 | } |
| 765 | 765 | } |
| 766 | 766 | |
@@ -847,7 +847,7 @@ discard block |
||
| 847 | 847 | $format = $paramValue; |
| 848 | 848 | $dateValue = date_create_from_format($format, $value); |
| 849 | 849 | if ($dateValue === false || $dateValue->format($format) !== $value) { |
| 850 | - $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
|
| 850 | + $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
|
| 851 | 851 | } |
| 852 | 852 | } |
| 853 | 853 | |
@@ -891,7 +891,7 @@ discard block |
||
| 891 | 891 | protected function checkRuleUrl($field, $rule, $paramValue) { |
| 892 | 892 | $value = $this->getFieldValue($field); |
| 893 | 893 | if (filter_var($value, FILTER_VALIDATE_URL) === false) { |
| 894 | - $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
|
| 894 | + $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
|
| 895 | 895 | } |
| 896 | 896 | } |
| 897 | 897 | |
@@ -906,7 +906,7 @@ discard block |
||
| 906 | 906 | protected function checkRuleIp($field, $rule, $paramValue) { |
| 907 | 907 | $value = $this->getFieldValue($field); |
| 908 | 908 | if (filter_var($value, FILTER_VALIDATE_IP) === false) { |
| 909 | - $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
|
| 909 | + $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
|
| 910 | 910 | } |
| 911 | 911 | } |
| 912 | 912 | |
@@ -951,7 +951,7 @@ discard block |
||
| 951 | 951 | $value = $this->getFieldValue($field); |
| 952 | 952 | list($table, $column) = explode('.', $paramValue); |
| 953 | 953 | $this->database->getQueryBuilder()->from($table) |
| 954 | - ->where($column, $value); |
|
| 954 | + ->where($column, $value); |
|
| 955 | 955 | $this->database->get(); |
| 956 | 956 | if ($this->database->numRows() > 0) { |
| 957 | 957 | $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
@@ -973,8 +973,8 @@ discard block |
||
| 973 | 973 | list($table, $column) = explode('.', $data[0]); |
| 974 | 974 | list($columnKey, $valueKey) = explode('=', $data[1]); |
| 975 | 975 | $this->database->getQueryBuilder()->from($table) |
| 976 | - ->where($column, $value) |
|
| 977 | - ->where($columnKey, '!=', trim($valueKey)); |
|
| 976 | + ->where($column, $value) |
|
| 977 | + ->where($columnKey, '!=', trim($valueKey)); |
|
| 978 | 978 | $this->database->get(); |
| 979 | 979 | if ($this->database->numRows() > 0) { |
| 980 | 980 | $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
@@ -994,7 +994,7 @@ discard block |
||
| 994 | 994 | $value = $this->getFieldValue($field); |
| 995 | 995 | list($table, $column) = explode('.', $paramValue); |
| 996 | 996 | $this->database->getQueryBuilder()->from($table) |
| 997 | - ->where($column, $value); |
|
| 997 | + ->where($column, $value); |
|
| 998 | 998 | $this->database->get(); |
| 999 | 999 | if ($this->database->numRows() <= 0) { |
| 1000 | 1000 | $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | * @return object the current instance |
| 425 | 425 | */ |
| 426 | 426 | protected function filterValidationData() { |
| 427 | - foreach ($this->data as $key => $value ) { |
|
| 427 | + foreach ($this->data as $key => $value) { |
|
| 428 | 428 | if (is_array($value)) { |
| 429 | 429 | $this->data[$key] = array_map('trim', $value); |
| 430 | 430 | } else { |
@@ -1037,7 +1037,7 @@ discard block |
||
| 1037 | 1037 | if (call_user_func_array($paramValue, array($value)) === false) { |
| 1038 | 1038 | $this->setFieldErrorWithRequiredCheck($field, $value, $rule, $paramValue); |
| 1039 | 1039 | } |
| 1040 | - } else{ |
|
| 1040 | + } else { |
|
| 1041 | 1041 | $this->forceError = true; |
| 1042 | 1042 | show_error('The callback validation function/method "' . $paramValue . '" does not exist'); |
| 1043 | 1043 | } |
@@ -121,7 +121,7 @@ |
||
| 121 | 121 | if ((double) $responseTime >= 1.000000) { |
| 122 | 122 | $this->logger->warning( |
| 123 | 123 | 'High response time while processing database query [' . $this->query . '].' |
| 124 | - . 'The response time is [' .$responseTime . '] sec.' |
|
| 124 | + . 'The response time is [' . $responseTime . '] sec.' |
|
| 125 | 125 | ); |
| 126 | 126 | } |
| 127 | 127 | |
@@ -30,10 +30,10 @@ |
||
| 30 | 30 | |
| 31 | 31 | class DatabaseQueryRunner extends BaseClass { |
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * The DatabaseConnection instance |
|
| 35 | - * @var object |
|
| 36 | - */ |
|
| 33 | + /** |
|
| 34 | + * The DatabaseConnection instance |
|
| 35 | + * @var object |
|
| 36 | + */ |
|
| 37 | 37 | private $connection = null; |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -32,8 +32,8 @@ |
||
| 32 | 32 | <p>Required PHP version : <b>PHP >= <?php echo TNH_MIN_PHP_VERSION; ?>, PHP < <?php echo TNH_MAX_PHP_VERSION; ?></b></p> |
| 33 | 33 | <p>Release date : <b><?php echo TNH_RELEASE_DATE; ?></b></p> |
| 34 | 34 | <hr /> |
| 35 | - <p>Current controller: <b class = "text-muted label-danger"><?php echo APPS_CONTROLLER_PATH . 'Home.php';?></b> |
|
| 36 | - <p>Current view: <b class = "text-muted label-danger"><?php echo APPS_VIEWS_PATH . 'home.php';?></b> |
|
| 35 | + <p>Current controller: <b class = "text-muted label-danger"><?php echo APPS_CONTROLLER_PATH . 'Home.php'; ?></b> |
|
| 36 | + <p>Current view: <b class = "text-muted label-danger"><?php echo APPS_VIEWS_PATH . 'home.php'; ?></b> |
|
| 37 | 37 | </div> |
| 38 | 38 | </div> |
| 39 | 39 | </div> |
@@ -234,10 +234,10 @@ discard block |
||
| 234 | 234 | return $this->removeVars($_ENV, $key); |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | - /** |
|
| 238 | - * Get the value from $GLOBALS for given key. if the key is empty will return all values |
|
| 239 | - * @see GlobalVar::getVars |
|
| 240 | - */ |
|
| 237 | + /** |
|
| 238 | + * Get the value from $GLOBALS for given key. if the key is empty will return all values |
|
| 239 | + * @see GlobalVar::getVars |
|
| 240 | + */ |
|
| 241 | 241 | public function globals($key = null, $xss = true) { |
| 242 | 242 | return $this->getVars($GLOBALS, $key, $xss); |
| 243 | 243 | } |
@@ -259,16 +259,16 @@ discard block |
||
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | |
| 262 | - /** |
|
| 263 | - * Set the value for $_GET, $_POST, $_SERVER etc. if the key is an array will |
|
| 264 | - * set the current super variable value by this. |
|
| 265 | - * @param array $var the super global variable to use, can be "$_POST", "$_GET", etc. |
|
| 266 | - * @param string|array $key the item key to be set or array if need set the current global variable |
|
| 267 | - * by this value |
|
| 268 | - * @param mixed $value the value to set if $key is not an array |
|
| 269 | - * |
|
| 270 | - * @return object the current instance |
|
| 271 | - */ |
|
| 262 | + /** |
|
| 263 | + * Set the value for $_GET, $_POST, $_SERVER etc. if the key is an array will |
|
| 264 | + * set the current super variable value by this. |
|
| 265 | + * @param array $var the super global variable to use, can be "$_POST", "$_GET", etc. |
|
| 266 | + * @param string|array $key the item key to be set or array if need set the current global variable |
|
| 267 | + * by this value |
|
| 268 | + * @param mixed $value the value to set if $key is not an array |
|
| 269 | + * |
|
| 270 | + * @return object the current instance |
|
| 271 | + */ |
|
| 272 | 272 | protected function setVars(&$var, $key, $value = null) { |
| 273 | 273 | if (is_array($key)) { |
| 274 | 274 | //set all |
@@ -207,10 +207,10 @@ |
||
| 207 | 207 | return $this; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - /** |
|
| 211 | - * Return the instance of session. |
|
| 212 | - * @return object the session instance |
|
| 213 | - */ |
|
| 210 | + /** |
|
| 211 | + * Return the instance of session. |
|
| 212 | + * @return object the session instance |
|
| 213 | + */ |
|
| 214 | 214 | public function getSession() { |
| 215 | 215 | return $this->session; |
| 216 | 216 | } |
@@ -163,17 +163,17 @@ |
||
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** |
| 166 | - * Return the server port using variable |
|
| 167 | - * |
|
| 168 | - * @codeCoverageIgnore |
|
| 169 | - * @return string |
|
| 170 | - */ |
|
| 166 | + * Return the server port using variable |
|
| 167 | + * |
|
| 168 | + * @codeCoverageIgnore |
|
| 169 | + * @return string |
|
| 170 | + */ |
|
| 171 | 171 | protected function getServerPort() { |
| 172 | 172 | $globals = & class_loader('GlobalVar', 'classes'); |
| 173 | 173 | $serverPortValue = $globals->server('SERVER_PORT'); |
| 174 | 174 | $serverPort = 80; |
| 175 | 175 | if ($serverPortValue) { |
| 176 | - $serverPort = $serverPortValue; |
|
| 176 | + $serverPort = $serverPortValue; |
|
| 177 | 177 | } |
| 178 | 178 | $port = ''; |
| 179 | 179 | if ((is_https() && $serverPort != 443) || (!is_https() && $serverPort != 80)) { |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $this->logger->debug('Check if the application contains the modules ...'); |
| 47 | 47 | $dirList = glob(MODULE_PATH . '*', GLOB_ONLYDIR); |
| 48 | 48 | if ($dirList !== false) { |
| 49 | - $this->list = array_map('basename', $dirList); |
|
| 49 | + $this->list = array_map('basename', $dirList); |
|
| 50 | 50 | } |
| 51 | 51 | if (!empty($this->list)) { |
| 52 | 52 | $this->logger->info('The application contains the module below [' . implode(', ', $this->list) . ']'); |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function add($name) { |
| 63 | 63 | if (in_array($name, $this->list)) { |
| 64 | - $this->logger->info('The module [' .$name. '] already added skipping.'); |
|
| 65 | - return $this; |
|
| 64 | + $this->logger->info('The module [' .$name. '] already added skipping.'); |
|
| 65 | + return $this; |
|
| 66 | 66 | } |
| 67 | 67 | $this->list[] = $name; |
| 68 | 68 | return $this; |
@@ -93,10 +93,10 @@ discard block |
||
| 93 | 93 | $this->list = array(); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - /** |
|
| 97 | - * Get the list of module loaded |
|
| 98 | - * @return array the module list |
|
| 99 | - */ |
|
| 96 | + /** |
|
| 97 | + * Get the list of module loaded |
|
| 98 | + * @return array the module list |
|
| 99 | + */ |
|
| 100 | 100 | public function getModuleList() { |
| 101 | 101 | return $this->list; |
| 102 | 102 | } |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | */ |
| 62 | 62 | public function add($name) { |
| 63 | 63 | if (in_array($name, $this->list)) { |
| 64 | - $this->logger->info('The module [' .$name. '] already added skipping.'); |
|
| 64 | + $this->logger->info('The module [' . $name . '] already added skipping.'); |
|
| 65 | 65 | return $this; |
| 66 | 66 | } |
| 67 | 67 | $this->list[] = $name; |
@@ -680,22 +680,22 @@ discard block |
||
| 680 | 680 | return $data; |
| 681 | 681 | } |
| 682 | 682 | |
| 683 | - /** |
|
| 684 | - * Get the return type array or object |
|
| 685 | - * @return string|boolean |
|
| 686 | - */ |
|
| 683 | + /** |
|
| 684 | + * Get the return type array or object |
|
| 685 | + * @return string|boolean |
|
| 686 | + */ |
|
| 687 | 687 | protected function getReturnType(){ |
| 688 | 688 | $type = false; |
| 689 | 689 | if ($this->_temporary_return_type == 'array') { |
| 690 | - $type = 'array'; |
|
| 690 | + $type = 'array'; |
|
| 691 | 691 | } |
| 692 | 692 | return $type; |
| 693 | 693 | } |
| 694 | 694 | |
| 695 | - /** |
|
| 696 | - * Check if soft delete is enable setting the condition |
|
| 697 | - * @return object the current instance |
|
| 698 | - */ |
|
| 695 | + /** |
|
| 696 | + * Check if soft delete is enable setting the condition |
|
| 697 | + * @return object the current instance |
|
| 698 | + */ |
|
| 699 | 699 | protected function checkForSoftDelete(){ |
| 700 | 700 | if ($this->soft_delete && $this->_temporary_with_deleted !== true) { |
| 701 | 701 | $this->getQueryBuilder()->where($this->soft_delete_key, (bool) $this->_temporary_only_deleted); |
@@ -703,14 +703,14 @@ discard block |
||
| 703 | 703 | return $this; |
| 704 | 704 | } |
| 705 | 705 | |
| 706 | - /** |
|
| 707 | - * Relate for "belongs_to" and "has_many" |
|
| 708 | - * @param string $relationship the name of relation |
|
| 709 | - * @param string|array $options the model and primary key values |
|
| 710 | - * @param object|array $row the row to update |
|
| 711 | - * @param string $type the type can be "belongs_to", "has_many" |
|
| 712 | - * @return mixed the final row values |
|
| 713 | - */ |
|
| 706 | + /** |
|
| 707 | + * Relate for "belongs_to" and "has_many" |
|
| 708 | + * @param string $relationship the name of relation |
|
| 709 | + * @param string|array $options the model and primary key values |
|
| 710 | + * @param object|array $row the row to update |
|
| 711 | + * @param string $type the type can be "belongs_to", "has_many" |
|
| 712 | + * @return mixed the final row values |
|
| 713 | + */ |
|
| 714 | 714 | protected function relateBelongsToAndHasMany($relationship, $options, $row, $type){ |
| 715 | 715 | if (in_array($relationship, $this->_with)) { |
| 716 | 716 | get_instance()->loader->model($options['model'], $relationship . '_model'); |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | $instance = $db; |
| 144 | 144 | } else { |
| 145 | 145 | $obj = & get_instance(); |
| 146 | - if (isset($obj->database)){ |
|
| 146 | + if (isset($obj->database)) { |
|
| 147 | 147 | /** |
| 148 | 148 | * NOTE: Need use "clone" because some Model need have the personal instance of the database library |
| 149 | 149 | * to prevent duplication |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | * Get the return type array or object |
| 685 | 685 | * @return string|boolean |
| 686 | 686 | */ |
| 687 | - protected function getReturnType(){ |
|
| 687 | + protected function getReturnType() { |
|
| 688 | 688 | $type = false; |
| 689 | 689 | if ($this->_temporary_return_type == 'array') { |
| 690 | 690 | $type = 'array'; |
@@ -696,7 +696,7 @@ discard block |
||
| 696 | 696 | * Check if soft delete is enable setting the condition |
| 697 | 697 | * @return object the current instance |
| 698 | 698 | */ |
| 699 | - protected function checkForSoftDelete(){ |
|
| 699 | + protected function checkForSoftDelete() { |
|
| 700 | 700 | if ($this->soft_delete && $this->_temporary_with_deleted !== true) { |
| 701 | 701 | $this->getQueryBuilder()->where($this->soft_delete_key, (bool) $this->_temporary_only_deleted); |
| 702 | 702 | } |
@@ -711,11 +711,11 @@ discard block |
||
| 711 | 711 | * @param string $type the type can be "belongs_to", "has_many" |
| 712 | 712 | * @return mixed the final row values |
| 713 | 713 | */ |
| 714 | - protected function relateBelongsToAndHasMany($relationship, $options, $row, $type){ |
|
| 714 | + protected function relateBelongsToAndHasMany($relationship, $options, $row, $type) { |
|
| 715 | 715 | if (in_array($relationship, $this->_with)) { |
| 716 | 716 | get_instance()->loader->model($options['model'], $relationship . '_model'); |
| 717 | 717 | |
| 718 | - if($type == 'belongs_to'){ |
|
| 718 | + if ($type == 'belongs_to') { |
|
| 719 | 719 | if (is_object($row)) { |
| 720 | 720 | $row->{$relationship} = $this->{$relationship . '_model'}->get($row->{$options['primary_key']}); |
| 721 | 721 | } else { |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * |
| 94 | 94 | * @codeCoverageIgnore |
| 95 | 95 | */ |
| 96 | - protected function startAppSession() { |
|
| 96 | + protected function startAppSession() { |
|
| 97 | 97 | //$_SESSION is not available on cli mode |
| 98 | 98 | if (!IS_CLI) { |
| 99 | 99 | //set session params |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * @codeCoverageIgnore |
| 144 | 144 | */ |
| 145 | 145 | protected function setAppSessionConfig() { |
| 146 | - //the default is to store in the files |
|
| 146 | + //the default is to store in the files |
|
| 147 | 147 | $sessionHandler = $this->config->get('session_handler', 'files'); |
| 148 | 148 | $this->logger->info('Session handler: ' . $sessionHandler); |
| 149 | 149 | if ($sessionHandler == 'files') { |