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

@@ 45-63 (lines=19) @@
42
     * @param $user
43
     * @return \Cv\Entity\Cv|null
44
     */
45
    public function findDraft($user)
46
    {
47
        if ($user instanceof UserInterface) {
48
            $user = $user->getId();
49
        }
50
51
        $document = $this->findOneBy(
52
            array(
53
                'isDraft' => true,
54
                'user' => $user
55
            )
56
        );
57
58
        if (!empty($document)) {
59
            return $document;
60
        }
61
62
        return null;
63
    }
64
}
65