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/Jobs/src/Jobs/Repository/Job.php 1 location

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

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