Code Duplication    Length = 17-18 lines in 3 locations

src/Place/ReadModel/Relations/Doctrine/DBALRepository.php 1 location

@@ 52-69 (lines=18) @@
49
        );
50
    }
51
52
    public function getPlacesOrganizedByOrganizer($organizerId)
53
    {
54
        $q = $this->connection->createQueryBuilder();
55
        $q
56
            ->select('place')
57
            ->from($this->tableName)
58
            ->where('organizer = ?')
59
            ->setParameter(0, $organizerId);
60
61
        $results = $q->execute();
62
63
        $places = array();
64
        while ($id = $results->fetchColumn(0)) {
65
            $places[] = $id;
66
        }
67
68
        return $places;
69
    }
70
71
    public function removeRelations($placeId)
72
    {

src/Event/ReadModel/Relations/Doctrine/DBALRepository.php 2 locations

@@ 165-181 (lines=17) @@
162
        );
163
    }
164
165
    public function getEventsLocatedAtPlace($placeId)
166
    {
167
        $q = $this->connection->createQueryBuilder();
168
        $q->select('event')
169
          ->from($this->tableName)
170
          ->where('place = ?')
171
          ->setParameter(0, $placeId);
172
173
        $results = $q->execute();
174
175
        $events = array();
176
        while ($id = $results->fetchColumn(0)) {
177
            $events[] = $id;
178
        }
179
180
        return $events;
181
    }
182
183
    public function getEventsOrganizedByOrganizer($organizerId)
184
    {
@@ 183-200 (lines=18) @@
180
        return $events;
181
    }
182
183
    public function getEventsOrganizedByOrganizer($organizerId)
184
    {
185
        $q = $this->connection->createQueryBuilder();
186
        $q
187
            ->select('event')
188
            ->from($this->tableName)
189
            ->where('organizer = ?')
190
            ->setParameter(0, $organizerId);
191
192
        $results = $q->execute();
193
194
        $events = array();
195
        while ($id = $results->fetchColumn(0)) {
196
            $events[] = $id;
197
        }
198
199
        return $events;
200
    }
201
202
    /**
203
     * @inheritdoc