Code Duplication    Length = 19-19 lines in 3 locations

module/Organizations/src/Organizations/Repository/Organization.php 1 location

@@ 276-294 (lines=19) @@
273
     * @param $user
274
     * @return \Organizations\Entity\Organization|null
275
     */
276
    public function findDraft($user)
277
    {
278
        if ($user instanceof UserInterface) {
279
            $user = $user->getId();
280
        }
281
282
        $document = $this->findOneBy(
283
            array(
284
            'isDraft' => true,
285
            'user' => $user
286
            )
287
        );
288
289
        if (!empty($document)) {
290
            return $document;
291
        }
292
293
        return null;
294
    }
295
}
296

module/Cv/src/Cv/Repository/Cv.php 1 location

@@ 20-38 (lines=19) @@
17
     * @param $user
18
     * @return \Cv\Entity\Cv|null
19
     */
20
    public function findDraft($user)
21
    {
22
        if ($user instanceof UserInterface) {
23
            $user = $user->getId();
24
        }
25
26
        $document = $this->findOneBy(
27
            array(
28
                'isDraft' => true,
29
                'user' => $user
30
            )
31
        );
32
33
        if (!empty($document)) {
34
            return $document;
35
        }
36
37
        return null;
38
    }
39
}
40

module/Jobs/src/Jobs/Repository/Job.php 1 location

@@ 100-118 (lines=19) @@
97
     * @param $user
98
     * @return \Jobs\Entity\Job|null
99
     */
100
    public function findDraft($user)
101
    {
102
        if ($user instanceof UserInterface) {
103
            $user = $user->getId();
104
        }
105
106
        $document = $this->findOneBy(
107
            array(
108
            'isDraft' => true,
109
            'user' => $user
110
            )
111
        );
112
113
        if (!empty($document)) {
114
            return $document;
115
        }
116
117
        return null;
118
    }
119
120
    /**
121
     * @return string