Code Duplication    Length = 19-19 lines in 2 locations

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

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

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

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