Code Duplication    Length = 24-24 lines in 2 locations

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

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