| @@ -26,9 +26,9 @@ | ||
| 26 | 26 | |
| 27 | 27 | namespace ntentan\nibii\relationships; | 
| 28 | 28 | |
| 29 | -use ntentan\nibii\exceptions\FieldNotFoundException; | |
| 30 | 29 | use ntentan\nibii\ORMContext; | 
| 31 | 30 | use ntentan\nibii\Relationship; | 
| 31 | +use ntentan\nibii\exceptions\FieldNotFoundException; | |
| 32 | 32 | use ntentan\utils\Text; | 
| 33 | 33 | |
| 34 | 34 | /** | 
| @@ -139,7 +139,7 @@ | ||
| 139 | 139 | public function describe($model, $relationships) | 
| 140 | 140 |      { | 
| 141 | 141 | return new ModelDescription( | 
| 142 | -            $this->driver->describeTable($table)[$table], $relationships, function ($type) { | |
| 142 | +            $this->driver->describeTable($table)[$table], $relationships, function($type) { | |
| 143 | 143 | return $this->mapDataTypes($type); | 
| 144 | 144 | } | 
| 145 | 145 | ); | 
| @@ -253,10 +253,10 @@ | ||
| 253 | 253 | $mainValidatorErrors = $validator->getInvalidFields(); | 
| 254 | 254 | } | 
| 255 | 255 | |
| 256 | -        if(!empty($this->wrapper->getValidationRules())) { | |
| 256 | +        if (!empty($this->wrapper->getValidationRules())) { | |
| 257 | 257 | $modelValidator = new Validator(); | 
| 258 | 258 | $modelValidator->setRules($this->wrapper->getValidationRules()); | 
| 259 | -            if(!$modelValidator->validate($data)) { | |
| 259 | +            if (!$modelValidator->validate($data)) { | |
| 260 | 260 | $modelValidatorErrors = $modelValidator->getInvalidFields(); | 
| 261 | 261 | } | 
| 262 | 262 | } | 
| @@ -28,10 +28,10 @@ | ||
| 28 | 28 | |
| 29 | 29 | use ntentan\atiaa\DbContext; | 
| 30 | 30 | use ntentan\kaikai\Cache; | 
| 31 | +use ntentan\nibii\exceptions\NibiiException; | |
| 31 | 32 | use ntentan\nibii\interfaces\DriverAdapterFactoryInterface; | 
| 32 | 33 | use ntentan\nibii\interfaces\ModelFactoryInterface; | 
| 33 | 34 | use ntentan\nibii\interfaces\ValidatorFactoryInterface; | 
| 34 | -use ntentan\nibii\exceptions\NibiiException; | |
| 35 | 35 | |
| 36 | 36 | /** | 
| 37 | 37 | * A global class with information and utilities required by the rest of the ORM system. | 
| @@ -26,8 +26,8 @@ | ||
| 26 | 26 | |
| 27 | 27 | namespace ntentan\nibii\relationships; | 
| 28 | 28 | |
| 29 | -use ntentan\nibii\exceptions\NibiiException; | |
| 30 | 29 | use ntentan\nibii\Relationship; | 
| 30 | +use ntentan\nibii\exceptions\NibiiException; | |
| 31 | 31 | use ntentan\utils\Text; | 
| 32 | 32 | |
| 33 | 33 | class HasManyRelationship extends Relationship | 
| @@ -68,7 +68,7 @@ | ||
| 68 | 68 | |
| 69 | 69 | public function postSave(&$wrapper) | 
| 70 | 70 |      { | 
| 71 | -        foreach($this->tempData as $relatedRecord) { | |
| 71 | +        foreach ($this->tempData as $relatedRecord) { | |
| 72 | 72 | $relatedRecord[$this->options['foreign_key']] = $wrapper[$this->options['local_key']]; | 
| 73 | 73 |              if (!$relatedRecord->save()) { | 
| 74 | 74 | var_dump($relatedRecord->getInvalidFields()); | 
| @@ -26,9 +26,9 @@ | ||
| 26 | 26 | |
| 27 | 27 | namespace ntentan\nibii\relationships; | 
| 28 | 28 | |
| 29 | -use ntentan\nibii\exceptions\NibiiException; | |
| 30 | 29 | use ntentan\nibii\ORMContext; | 
| 31 | 30 | use ntentan\nibii\Relationship; | 
| 31 | +use ntentan\nibii\exceptions\NibiiException; | |
| 32 | 32 | use ntentan\utils\Text; | 
| 33 | 33 | |
| 34 | 34 | class ManyHaveManyRelationship extends Relationship | 
| @@ -211,7 +211,7 @@ discard block | ||
| 211 | 211 | $this->initialize(); | 
| 212 | 212 | |
| 213 | 213 | return $this->context->getCache()->read( | 
| 214 | -            "{$this->className}::desc", function () { | |
| 214 | +            "{$this->className}::desc", function() { | |
| 215 | 215 | return $this->context->getModelDescription($this); | 
| 216 | 216 | } | 
| 217 | 217 | ); | 
| @@ -443,7 +443,7 @@ discard block | ||
| 443 | 443 |      { | 
| 444 | 444 | $data = $index ? $this->modelData[$index] : $this->modelData; | 
| 445 | 445 | $name = $relationship->getOptions()['name']; | 
| 446 | - if(isset($data[$name])) | |
| 446 | + if (isset($data[$name])) | |
| 447 | 447 |          { | 
| 448 | 448 | return $data[$name]; | 
| 449 | 449 | } |