Code Duplication    Length = 11-15 lines in 4 locations

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

@@ 1674-1684 (lines=11) @@
1671
        }
1672
1673
        // relation type
1674
        if (isset($relationType)) {
1675
            $query->where(
1676
                $query->expr->gt(
1677
                    $query->expr->bitAnd(
1678
                        $this->dbHandler->quoteColumn('relation_type', 'ezcontentobject_link'),
1679
                        $query->bindValue($relationType, null, \PDO::PARAM_INT)
1680
                    ),
1681
                    0
1682
                )
1683
            );
1684
        }
1685
1686
        $statement = $query->prepare();
1687
        $statement->execute();
@@ 1731-1741 (lines=11) @@
1728
        );
1729
1730
        // relation type
1731
        if (isset($relationType)) {
1732
            $query->where(
1733
                $query->expr->gt(
1734
                    $query->expr->bitAnd(
1735
                        $this->dbHandler->quoteColumn('relation_type', 'ezcontentobject_link'),
1736
                        $query->bindValue($relationType, null, \PDO::PARAM_INT)
1737
                    ),
1738
                    0
1739
                )
1740
            );
1741
        }
1742
1743
        $statement = $query->prepare();
1744

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

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