Code Duplication    Length = 11-15 lines in 4 locations

eZ/Publish/Core/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php 2 locations

@@ 1603-1613 (lines=11) @@
1600
        }
1601
1602
        // relation type
1603
        if (isset($relationType)) {
1604
            $query->where(
1605
                $query->expr->gt(
1606
                    $query->expr->bitAnd(
1607
                        $this->dbHandler->quoteColumn('relation_type', 'ezcontentobject_link'),
1608
                        $query->bindValue($relationType, null, \PDO::PARAM_INT)
1609
                    ),
1610
                    0
1611
                )
1612
            );
1613
        }
1614
1615
        $statement = $query->prepare();
1616
        $statement->execute();
@@ 1660-1670 (lines=11) @@
1657
        );
1658
1659
        // relation type
1660
        if (isset($relationType)) {
1661
            $query->where(
1662
                $query->expr->gt(
1663
                    $query->expr->bitAnd(
1664
                        $this->dbHandler->quoteColumn('relation_type', 'ezcontentobject_link'),
1665
                        $query->bindValue($relationType, null, \PDO::PARAM_INT)
1666
                    ),
1667
                    0
1668
                )
1669
            );
1670
        }
1671
1672
        $statement = $query->prepare();
1673

eZ/Publish/Core/Persistence/Legacy/Content/UrlAlias/Gateway/DoctrineDatabase.php 2 locations

@@ 141-151 (lines=11) @@
138
            )
139
        );
140
141
        if ($languageId !== false) {
142
            $query->where(
143
                $query->expr->gt(
144
                    $query->expr->bitAnd(
145
                        $this->dbHandler->quoteColumn('lang_mask'),
146
                        $query->bindValue($languageId, null, \PDO::PARAM_INT)
147
                    ),
148
                    0
149
                )
150
            );
151
        }
152
153
        $statement = $query->prepare();
154
        $statement->execute();
@@ 205-219 (lines=15) @@
202
            $limit,
203
            $offset
204
        );
205
        if (isset($languageCode)) {
206
            $query->where(
207
                $query->expr->gt(
208
                    $query->expr->bitAnd(
209
                        $this->dbHandler->quoteColumn('lang_mask'),
210
                        $query->bindValue(
211
                            $this->languageMaskGenerator->generateLanguageIndicator($languageCode, false),
212
                            null,
213
                            \PDO::PARAM_INT
214
                        )
215
                    ),
216
                    0
217
                )
218
            );
219
        }
220
        $statement = $query->prepare();
221
        $statement->execute();
222