Code Duplication    Length = 11-11 lines in 2 locations

src/Suricate/DBObject.php 2 locations

@@ 381-391 (lines=11) @@
378
        return true;
379
    }
380
381
    private function loadRelationOneMany($name)
382
    {
383
        $target         = $this->relations[$name]['target'];
384
        $parentId       = $this->{$this->relations[$name]['source']};
385
        $parentIdField  = isset($this->relations[$name]['target_field']) ? $this->relations[$name]['target_field'] : null;
386
        $validate       = dataGet($this->relations[$name], 'validate', null);
387
        
388
        $this->relationValues[$name] = $target::loadForParentId($parentId, $parentIdField, $validate);
389
390
        return true;
391
    }
392
393
    private function loadRelationManyMany($name)
394
    {
@@ 393-403 (lines=11) @@
390
        return true;
391
    }
392
393
    private function loadRelationManyMany($name)
394
    {
395
        $pivot      = $this->relations[$name]['pivot'];
396
        $sourceType = $this->relations[$name]['source_type'];
397
        $target     = dataGet($this->relations[$name], 'target');
398
        $validate   = dataGet($this->relations[$name], 'validate', null);
399
400
        $this->relationValues[$name] = $pivot::loadFor($sourceType, $this->{$this->relations[$name]['source']}, $target, $validate);
401
        
402
        return true;
403
    }
404
405
    private function resetLoadedVariables()
406
    {