@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | public function getCacheContent() { |
| 159 | 159 | //set some attributes values |
| 160 | 160 | $this->setPropertiesValues(); |
| 161 | - if(! $this->isSelectQuery || ! $this->dbCacheStatus){ |
|
| 161 | + if (!$this->isSelectQuery || !$this->dbCacheStatus) { |
|
| 162 | 162 | $this->logger->info('The cache is not enabled for this query or is not a SELECT query'); |
| 163 | 163 | return null; |
| 164 | 164 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | public function saveCacheContent($result) { |
| 180 | 180 | //set some attributes values |
| 181 | 181 | $this->setPropertiesValues(); |
| 182 | - if(! $this->isSelectQuery || ! $this->dbCacheStatus){ |
|
| 182 | + if (!$this->isSelectQuery || !$this->dbCacheStatus) { |
|
| 183 | 183 | return null; |
| 184 | 184 | } |
| 185 | 185 | $this->setCacheFromSuperInstanceIfNull(); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | class Model { |
| 41 | 41 | |
| 42 | - /** |
|
| 42 | + /** |
|
| 43 | 43 | * This model's default database table. |
| 44 | 44 | * @var string the name of table |
| 45 | 45 | */ |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | * Only get deleted rows on the next call |
| 629 | 629 | * |
| 630 | 630 | * @return object the current instance |
| 631 | - */ |
|
| 631 | + */ |
|
| 632 | 632 | public function onlyRecordDeleted() { |
| 633 | 633 | $this->returnOnlyRecordDeleted = true; |
| 634 | 634 | return $this; |
@@ -833,23 +833,23 @@ discard block |
||
| 833 | 833 | return false; |
| 834 | 834 | } |
| 835 | 835 | |
| 836 | - /** |
|
| 837 | - * Get the record return type array or object |
|
| 838 | - * |
|
| 839 | - * @return string|boolean |
|
| 840 | - */ |
|
| 836 | + /** |
|
| 837 | + * Get the record return type array or object |
|
| 838 | + * |
|
| 839 | + * @return string|boolean |
|
| 840 | + */ |
|
| 841 | 841 | protected function getReturnType(){ |
| 842 | 842 | $type = false; |
| 843 | 843 | if ($this->temporaryReturnRecordType == 'array') { |
| 844 | - $type = 'array'; |
|
| 844 | + $type = 'array'; |
|
| 845 | 845 | } |
| 846 | 846 | return $type; |
| 847 | 847 | } |
| 848 | 848 | |
| 849 | - /** |
|
| 850 | - * Check if soft delete is enable setting the condition |
|
| 851 | - * @return object the current instance |
|
| 852 | - */ |
|
| 849 | + /** |
|
| 850 | + * Check if soft delete is enable setting the condition |
|
| 851 | + * @return object the current instance |
|
| 852 | + */ |
|
| 853 | 853 | protected function checkForSoftDelete(){ |
| 854 | 854 | if ($this->softDeleteStatus && $this->returnRecordWithDeleted !== true) { |
| 855 | 855 | $this->getQueryBuilder()->where( |
@@ -860,16 +860,16 @@ discard block |
||
| 860 | 860 | return $this; |
| 861 | 861 | } |
| 862 | 862 | |
| 863 | - /** |
|
| 864 | - * Relate for "manyToOne" and "oneToMany" |
|
| 865 | - * |
|
| 866 | - * @param string $relationship the name of relation |
|
| 867 | - * @param string|array $options the model and primary key values |
|
| 868 | - * @param object|array $row the row to update |
|
| 869 | - * @param string $type the type can be "manyToOne", "oneToMany" |
|
| 870 | - * |
|
| 871 | - * @return array|object the final row values |
|
| 872 | - */ |
|
| 863 | + /** |
|
| 864 | + * Relate for "manyToOne" and "oneToMany" |
|
| 865 | + * |
|
| 866 | + * @param string $relationship the name of relation |
|
| 867 | + * @param string|array $options the model and primary key values |
|
| 868 | + * @param object|array $row the row to update |
|
| 869 | + * @param string $type the type can be "manyToOne", "oneToMany" |
|
| 870 | + * |
|
| 871 | + * @return array|object the final row values |
|
| 872 | + */ |
|
| 873 | 873 | protected function relateOneToManyAndManyToOne($relationship, $options, $row, $type){ |
| 874 | 874 | if (in_array($relationship, $this->withs)) { |
| 875 | 875 | get_instance()->loader->model($options['model'], $relationship . '_model'); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $instance = $db; |
| 185 | 185 | } else { |
| 186 | 186 | $obj = & get_instance(); |
| 187 | - if (isset($obj->database)){ |
|
| 187 | + if (isset($obj->database)) { |
|
| 188 | 188 | /** |
| 189 | 189 | * NOTE: Need use "clone" because some Model need have the personal instance of the database library |
| 190 | 190 | * to prevent duplication |
@@ -838,7 +838,7 @@ discard block |
||
| 838 | 838 | * |
| 839 | 839 | * @return string|boolean |
| 840 | 840 | */ |
| 841 | - protected function getReturnType(){ |
|
| 841 | + protected function getReturnType() { |
|
| 842 | 842 | $type = false; |
| 843 | 843 | if ($this->temporaryReturnRecordType == 'array') { |
| 844 | 844 | $type = 'array'; |
@@ -850,7 +850,7 @@ discard block |
||
| 850 | 850 | * Check if soft delete is enable setting the condition |
| 851 | 851 | * @return object the current instance |
| 852 | 852 | */ |
| 853 | - protected function checkForSoftDelete(){ |
|
| 853 | + protected function checkForSoftDelete() { |
|
| 854 | 854 | if ($this->softDeleteStatus && $this->returnRecordWithDeleted !== true) { |
| 855 | 855 | $this->getQueryBuilder()->where( |
| 856 | 856 | $this->softDeleteTableColumn, |
@@ -870,11 +870,11 @@ discard block |
||
| 870 | 870 | * |
| 871 | 871 | * @return array|object the final row values |
| 872 | 872 | */ |
| 873 | - protected function relateOneToManyAndManyToOne($relationship, $options, $row, $type){ |
|
| 873 | + protected function relateOneToManyAndManyToOne($relationship, $options, $row, $type) { |
|
| 874 | 874 | if (in_array($relationship, $this->withs)) { |
| 875 | 875 | get_instance()->loader->model($options['model'], $relationship . '_model'); |
| 876 | 876 | $model = get_instance()->{$relationship . '_model'}; |
| 877 | - if($type == 'manyToOne'){ |
|
| 877 | + if ($type == 'manyToOne') { |
|
| 878 | 878 | if (is_object($row)) { |
| 879 | 879 | $row->{$relationship} = $model->getSingleRecord($row->{$options['primary_key']}); |
| 880 | 880 | } else { |