Code Duplication    Length = 15-16 lines in 2 locations

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

@@ 2148-2163 (lines=16) @@
2145
     * @param string $languageCode language code of the translation
2146
     * @throws \Doctrine\DBAL\DBALException
2147
     */
2148
    public function deleteTranslationFromContent($contentId, $languageCode)
2149
    {
2150
        $language = $this->languageHandler->loadByLanguageCode($languageCode);
2151
2152
        $this->connection->beginTransaction();
2153
        try {
2154
            $this->deleteTranslationFromContentVersions($contentId, $language->id);
2155
            $this->deleteTranslationFromContentNames($contentId, $languageCode);
2156
            $this->deleteTranslationFromContentObject($contentId, $language->id);
2157
2158
            $this->connection->commit();
2159
        } catch (DBALException $e) {
2160
            $this->connection->rollBack();
2161
            throw $e;
2162
        }
2163
    }
2164
2165
    /**
2166
     * Delete Content fields (attributes) for the given Translation.
@@ 2206-2220 (lines=15) @@
2203
     * @param string $languageCode
2204
     * @throws \Doctrine\DBAL\DBALException
2205
     */
2206
    public function deleteTranslationFromVersion($contentId, $versionNo, $languageCode)
2207
    {
2208
        $language = $this->languageHandler->loadByLanguageCode($languageCode);
2209
2210
        $this->connection->beginTransaction();
2211
        try {
2212
            $this->deleteTranslationFromContentVersions($contentId, $language->id, $versionNo);
2213
            $this->deleteTranslationFromContentNames($contentId, $languageCode, $versionNo);
2214
2215
            $this->connection->commit();
2216
        } catch (DBALException $e) {
2217
            $this->connection->rollBack();
2218
            throw $e;
2219
        }
2220
    }
2221
2222
    /**
2223
     * Delete translation from the ezcontentobject_name table.