Code Duplication    Length = 7-9 lines in 3 locations

src/Distilleries/Expendable/Scopes/Translatable.php 3 locations

@@ 112-118 (lines=7) @@
109
        return $translation->save();
110
    }
111
112
    public function getIso($model, $id_element)
113
    {
114
        $translation = Translation::where($this->getQualifiedIdElementColumn(), '=', $id_element)
115
            ->where($this->getQualifiedModelColumn(), '=', $model)->get()->last();
116
117
        return (!empty($translation->iso)) ? $translation->iso : false;
118
    }
119
120
    public function hasBeenTranslated($model, $id_source, $iso)
121
    {
@@ 120-128 (lines=9) @@
117
        return (!empty($translation->iso)) ? $translation->iso : false;
118
    }
119
120
    public function hasBeenTranslated($model, $id_source, $iso)
121
    {
122
        $translation = Translation::where($this->getQualifiedIdSourceColumn(), '=', $id_source)
123
            ->where($this->getQualifiedModelColumn(), '=', $model)
124
            ->where($this->getQualifiedIsoColumn(), '=', $iso)
125
            ->get()->last();
126
127
        return (!empty($translation->id_element)) ? $translation->id_element : false;
128
    }
129
130
    public function hasTranslation($model, $id_element)
131
    {
@@ 130-136 (lines=7) @@
127
        return (!empty($translation->id_element)) ? $translation->id_element : false;
128
    }
129
130
    public function hasTranslation($model, $id_element)
131
    {
132
        $translation = Translation::where($this->getQualifiedIdElementColumn(), '=', $id_element)
133
            ->where($this->getQualifiedModelColumn(), '=', $model)->count();
134
135
        return (!empty($translation)) ? true : false;
136
    }
137
}