Code Duplication    Length = 8-12 lines in 3 locations

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

@@ 56-63 (lines=8) @@
53
    /**
54
     * {@inheritDoc}
55
     */
56
    public function createQueryBuilder($findDrafts = false)
57
    {
58
        $qb = parent::createQueryBuilder();
59
        if (null !== $findDrafts) {
60
            $qb->field('isDraft')->equals($findDrafts);
61
        }
62
        return $qb;
63
    }
64
    
65
    /**
66
     * Gets a pointer to an application

module/Auth/src/Auth/Repository/User.php 1 location

@@ 82-89 (lines=8) @@
79
    /**
80
     * {@inheritDoc}
81
     */
82
    public function createQueryBuilder($findDrafts = false)
83
    {
84
        $qb = parent::createQueryBuilder();
85
        if (null !== $findDrafts) {
86
            $qb->field('isDraft')->equals($findDrafts);
87
        }
88
        return $qb;
89
    }
90
91
    /**
92
     * Creates a User

module/Core/src/Core/Repository/DraftableEntityAwareTrait.php 1 location

@@ 101-112 (lines=12) @@
98
     *
99
     * @return \Doctrine\MongoDB\Query\Builder
100
     */
101
    public function createQueryBuilder($findDrafts = false)
102
    {
103
        /* @var \Doctrine\MongoDB\Query\Builder $qb */
104
        /** @noinspection PhpUndefinedClassInspection */
105
        /** @noinspection PhpUndefinedMethodInspection */
106
        $qb = parent::createQueryBuilder();
107
108
        if (null !== $findDrafts) {
109
            $qb->field('isDraft')->equals($findDrafts);
110
        }
111
        return $qb;
112
    }
113
114
    /**
115
     * Creates an entity in draft mode.