Code Duplication    Length = 15-16 lines in 2 locations

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

@@ 2068-2083 (lines=16) @@
2065
     * @param string $languageCode language code of the translation
2066
     * @throws \Doctrine\DBAL\DBALException
2067
     */
2068
    public function deleteTranslationFromContent($contentId, $languageCode)
2069
    {
2070
        $language = $this->languageHandler->loadByLanguageCode($languageCode);
2071
2072
        $this->connection->beginTransaction();
2073
        try {
2074
            $this->deleteTranslationFromContentVersions($contentId, $language->id);
2075
            $this->deleteTranslationFromContentNames($contentId, $languageCode);
2076
            $this->deleteTranslationFromContentObject($contentId, $language->id);
2077
2078
            $this->connection->commit();
2079
        } catch (DBALException $e) {
2080
            $this->connection->rollBack();
2081
            throw $e;
2082
        }
2083
    }
2084
2085
    /**
2086
     * Delete Content fields (attributes) for the given Translation.
@@ 2126-2140 (lines=15) @@
2123
     * @param string $languageCode
2124
     * @throws \Doctrine\DBAL\DBALException
2125
     */
2126
    public function deleteTranslationFromVersion($contentId, $versionNo, $languageCode)
2127
    {
2128
        $language = $this->languageHandler->loadByLanguageCode($languageCode);
2129
2130
        $this->connection->beginTransaction();
2131
        try {
2132
            $this->deleteTranslationFromContentVersions($contentId, $language->id, $versionNo);
2133
            $this->deleteTranslationFromContentNames($contentId, $languageCode, $versionNo);
2134
2135
            $this->connection->commit();
2136
        } catch (DBALException $e) {
2137
            $this->connection->rollBack();
2138
            throw $e;
2139
        }
2140
    }
2141
2142
    /**
2143
     * Delete translation from the ezcontentobject_name table.