Code Duplication    Length = 24-24 lines in 2 locations

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

@@ 2129-2152 (lines=24) @@
2126
     * @param int $contentId
2127
     * @param int $versionNo (optional) filter by versionNo
2128
     */
2129
    public function deleteTranslatedFields($languageCode, $contentId, $versionNo = null)
2130
    {
2131
        $query = $this->connection->createQueryBuilder();
2132
        $query
2133
            ->delete('ezcontentobject_attribute')
2134
            ->where('contentobject_id = :contentId')
2135
            ->andWhere('language_code = :languageCode')
2136
            ->setParameters(
2137
                [
2138
                    ':contentId' => $contentId,
2139
                    ':languageCode' => $languageCode,
2140
                ]
2141
            )
2142
        ;
2143
2144
        if (null !== $versionNo) {
2145
            $query
2146
                ->andWhere('version = :versionNo')
2147
                ->setParameter(':versionNo', $versionNo)
2148
            ;
2149
        }
2150
2151
        $query->execute();
2152
    }
2153
2154
    /**
2155
     * Delete the specified Translation from the given Version.
@@ 2185-2208 (lines=24) @@
2182
     * @param string $languageCode
2183
     * @param int $versionNo optional, if specified, apply to this Version only.
2184
     */
2185
    private function deleteTranslationFromContentNames($contentId, $languageCode, $versionNo = null)
2186
    {
2187
        $query = $this->connection->createQueryBuilder();
2188
        $query
2189
            ->delete('ezcontentobject_name')
2190
            ->where('contentobject_id=:contentId')
2191
            ->andWhere('real_translation=:languageCode')
2192
            ->setParameters(
2193
                [
2194
                    ':languageCode' => $languageCode,
2195
                    ':contentId' => $contentId,
2196
                ]
2197
            )
2198
        ;
2199
2200
        if (null !== $versionNo) {
2201
            $query
2202
                ->andWhere('content_version = :versionNo')
2203
                ->setParameter(':versionNo', $versionNo)
2204
            ;
2205
        }
2206
2207
        $query->execute();
2208
    }
2209
2210
    /**
2211
     * Remove language from language_mask of ezcontentobject.