Code Duplication    Length = 12-12 lines in 3 locations

module/Applications/src/Applications/Repository/Application.php 1 location

@@ 232-243 (lines=12) @@
229
     * @return Cursor
230
     * @since 0.27
231
     */
232
    public function getUserApplications($userId, $limit = null)
233
    {
234
        $qb = $this->createQueryBuilder(null)
235
            ->field('user')->equals($userId)
236
            ->sort(['date' => -1]);
237
    
238
        if (isset($limit)) {
239
            $qb->limit($limit);
240
        }
241
    
242
        return $qb->getQuery()->execute();
243
    }
244
}
245

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

@@ 195-206 (lines=12) @@
192
     * @return Cursor
193
     * @since 0.27
194
     */
195
    public function getUserJobs($userId, $limit = null)
196
    {
197
        $qb = $this->createQueryBuilder()
198
            ->field('user')->equals($userId)
199
            ->sort(['dateCreated.date' => -1]);
200
        
201
        if (isset($limit)) {
202
            $qb->limit($limit);
203
        }
204
    
205
        return $qb->getQuery()->execute();
206
    }
207
}
208

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

@@ 305-316 (lines=12) @@
302
     * @return Cursor
303
     * @since 0.27
304
     */
305
    public function getUserOrganizations($userId, $limit = null)
306
    {
307
        $qb = $this->createQueryBuilder(null)
308
            ->field('user')->equals($userId)
309
            ->sort(['DateCreated.date' => -1]);
310
    
311
        if (isset($limit)) {
312
            $qb->limit($limit);
313
        }
314
    
315
        return $qb->getQuery()->execute();
316
    }
317
}
318