Code Duplication    Length = 24-24 lines in 2 locations

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

@@ 2179-2202 (lines=24) @@
2176
     * @param int $contentId
2177
     * @param int $versionNo (optional) filter by versionNo
2178
     */
2179
    public function deleteTranslatedFields($languageCode, $contentId, $versionNo = null)
2180
    {
2181
        $query = $this->connection->createQueryBuilder();
2182
        $query
2183
            ->delete('ezcontentobject_attribute')
2184
            ->where('contentobject_id = :contentId')
2185
            ->andWhere('language_code = :languageCode')
2186
            ->setParameters(
2187
                [
2188
                    ':contentId' => $contentId,
2189
                    ':languageCode' => $languageCode,
2190
                ]
2191
            )
2192
        ;
2193
2194
        if (null !== $versionNo) {
2195
            $query
2196
                ->andWhere('version = :versionNo')
2197
                ->setParameter(':versionNo', $versionNo)
2198
            ;
2199
        }
2200
2201
        $query->execute();
2202
    }
2203
2204
    /**
2205
     * Delete the specified Translation from the given Version.
@@ 2235-2258 (lines=24) @@
2232
     * @param string $languageCode
2233
     * @param int $versionNo optional, if specified, apply to this Version only.
2234
     */
2235
    private function deleteTranslationFromContentNames($contentId, $languageCode, $versionNo = null)
2236
    {
2237
        $query = $this->connection->createQueryBuilder();
2238
        $query
2239
            ->delete('ezcontentobject_name')
2240
            ->where('contentobject_id=:contentId')
2241
            ->andWhere('real_translation=:languageCode')
2242
            ->setParameters(
2243
                [
2244
                    ':languageCode' => $languageCode,
2245
                    ':contentId' => $contentId,
2246
                ]
2247
            )
2248
        ;
2249
2250
        if (null !== $versionNo) {
2251
            $query
2252
                ->andWhere('content_version = :versionNo')
2253
                ->setParameter(':versionNo', $versionNo)
2254
            ;
2255
        }
2256
2257
        $query->execute();
2258
    }
2259
2260
    /**
2261
     * Remove language from language_mask of ezcontentobject.