Code Duplication    Length = 24-24 lines in 2 locations

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

@@ 2081-2104 (lines=24) @@
2078
     * @param int $contentId
2079
     * @param int $versionNo (optional) filter by versionNo
2080
     */
2081
    public function deleteTranslatedFields($languageCode, $contentId, $versionNo = null)
2082
    {
2083
        $query = $this->connection->createQueryBuilder();
2084
        $query
2085
            ->delete('ezcontentobject_attribute')
2086
            ->where('contentobject_id = :contentId')
2087
            ->andWhere('language_code = :languageCode')
2088
            ->setParameters(
2089
                [
2090
                    ':contentId' => $contentId,
2091
                    ':languageCode' => $languageCode,
2092
                ]
2093
            )
2094
        ;
2095
2096
        if (null !== $versionNo) {
2097
            $query
2098
                ->andWhere('version = :versionNo')
2099
                ->setParameter(':versionNo', $versionNo)
2100
            ;
2101
        }
2102
2103
        $query->execute();
2104
    }
2105
2106
    /**
2107
     * Delete the specified Translation from the given Version.
@@ 2137-2160 (lines=24) @@
2134
     * @param string $languageCode
2135
     * @param int $versionNo optional, if specified, apply to this Version only.
2136
     */
2137
    private function deleteTranslationFromContentNames($contentId, $languageCode, $versionNo = null)
2138
    {
2139
        $query = $this->connection->createQueryBuilder();
2140
        $query
2141
            ->delete('ezcontentobject_name')
2142
            ->where('contentobject_id=:contentId')
2143
            ->andWhere('real_translation=:languageCode')
2144
            ->setParameters(
2145
                [
2146
                    ':languageCode' => $languageCode,
2147
                    ':contentId' => $contentId,
2148
                ]
2149
            )
2150
        ;
2151
2152
        if (null !== $versionNo) {
2153
            $query
2154
                ->andWhere('content_version = :versionNo')
2155
                ->setParameter(':versionNo', $versionNo)
2156
            ;
2157
        }
2158
2159
        $query->execute();
2160
    }
2161
2162
    /**
2163
     * Remove language from language_mask of ezcontentobject.