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

@@ 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

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

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