Code Duplication    Length = 24-24 lines in 2 locations

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

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