Code Duplication    Length = 24-24 lines in 2 locations

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

@@ 2166-2189 (lines=24) @@
2163
     * @param int $contentId
2164
     * @param int $versionNo (optional) filter by versionNo
2165
     */
2166
    public function deleteTranslatedFields($languageCode, $contentId, $versionNo = null)
2167
    {
2168
        $query = $this->connection->createQueryBuilder();
2169
        $query
2170
            ->delete('ezcontentobject_attribute')
2171
            ->where('contentobject_id = :contentId')
2172
            ->andWhere('language_code = :languageCode')
2173
            ->setParameters(
2174
                [
2175
                    ':contentId' => $contentId,
2176
                    ':languageCode' => $languageCode,
2177
                ]
2178
            )
2179
        ;
2180
2181
        if (null !== $versionNo) {
2182
            $query
2183
                ->andWhere('version = :versionNo')
2184
                ->setParameter(':versionNo', $versionNo)
2185
            ;
2186
        }
2187
2188
        $query->execute();
2189
    }
2190
2191
    /**
2192
     * Delete the specified Translation from the given Version.
@@ 2222-2245 (lines=24) @@
2219
     * @param string $languageCode
2220
     * @param int $versionNo optional, if specified, apply to this Version only.
2221
     */
2222
    private function deleteTranslationFromContentNames($contentId, $languageCode, $versionNo = null)
2223
    {
2224
        $query = $this->connection->createQueryBuilder();
2225
        $query
2226
            ->delete('ezcontentobject_name')
2227
            ->where('contentobject_id=:contentId')
2228
            ->andWhere('real_translation=:languageCode')
2229
            ->setParameters(
2230
                [
2231
                    ':languageCode' => $languageCode,
2232
                    ':contentId' => $contentId,
2233
                ]
2234
            )
2235
        ;
2236
2237
        if (null !== $versionNo) {
2238
            $query
2239
                ->andWhere('content_version = :versionNo')
2240
                ->setParameter(':versionNo', $versionNo)
2241
            ;
2242
        }
2243
2244
        $query->execute();
2245
    }
2246
2247
    /**
2248
     * Remove language from language_mask of ezcontentobject.