Code Duplication    Length = 9-11 lines in 2 locations

src/Relations/HasAndBelongsToMany.php 1 location

@@ 101-109 (lines=9) @@
98
    /**
99
     * @inheritdoc
100
     */
101
    public function populateQuerySpecific(AbstractQuery $query)
102
    {
103
        $pk1 = $this->getPrimaryKey();
104
        $fk1 = $this->getFK();
105
106
        $query->where("`{$this->getTable()}`.`$fk1` = ?", $this->getItem()->{$pk1});
107
108
        return $query;
109
    }
110
111
    /**
112
     * Simple select query from the link table

src/Relations/MorphToMany.php 1 location

@@ 75-85 (lines=11) @@
72
     * @param AbstractQuery $query
73
     * @return AbstractQuery
74
     */
75
    public function populateQuerySpecific(AbstractQuery $query)
76
    {
77
        if ($this->isInverse()) {
78
            return parent::populateQuerySpecific($query);
79
        }
80
        $primaryKey = $this->getPrimaryKey();
81
82
        $query->where("`{$this->getTable()}`.`pivotal_id` = ?", $this->getItem()->{$primaryKey});
83
84
        return $query;
85
    }
86
87
    /**
88
     * @inheritdoc