|
@@ 1959-1974 (lines=16) @@
|
| 1956 |
|
* @param string $languageCode language code of the translation |
| 1957 |
|
* @throws \Doctrine\DBAL\DBALException |
| 1958 |
|
*/ |
| 1959 |
|
public function deleteTranslationFromContent($contentId, $languageCode) |
| 1960 |
|
{ |
| 1961 |
|
$language = $this->languageHandler->loadByLanguageCode($languageCode); |
| 1962 |
|
|
| 1963 |
|
$this->connection->beginTransaction(); |
| 1964 |
|
try { |
| 1965 |
|
$this->deleteTranslationFromContentVersions($contentId, $language->id); |
| 1966 |
|
$this->deleteTranslationFromContentNames($contentId, $languageCode); |
| 1967 |
|
$this->deleteTranslationFromContentObject($contentId, $language->id); |
| 1968 |
|
|
| 1969 |
|
$this->connection->commit(); |
| 1970 |
|
} catch (DBALException $e) { |
| 1971 |
|
$this->connection->rollBack(); |
| 1972 |
|
throw $e; |
| 1973 |
|
} |
| 1974 |
|
} |
| 1975 |
|
|
| 1976 |
|
/** |
| 1977 |
|
* Delete Content fields (attributes) for the given Translation. |
|
@@ 2017-2031 (lines=15) @@
|
| 2014 |
|
* @param string $languageCode |
| 2015 |
|
* @throws \Doctrine\DBAL\DBALException |
| 2016 |
|
*/ |
| 2017 |
|
public function deleteTranslationFromVersion($contentId, $versionNo, $languageCode) |
| 2018 |
|
{ |
| 2019 |
|
$language = $this->languageHandler->loadByLanguageCode($languageCode); |
| 2020 |
|
|
| 2021 |
|
$this->connection->beginTransaction(); |
| 2022 |
|
try { |
| 2023 |
|
$this->deleteTranslationFromContentVersions($contentId, $language->id, $versionNo); |
| 2024 |
|
$this->deleteTranslationFromContentNames($contentId, $languageCode, $versionNo); |
| 2025 |
|
|
| 2026 |
|
$this->connection->commit(); |
| 2027 |
|
} catch (DBALException $e) { |
| 2028 |
|
$this->connection->rollBack(); |
| 2029 |
|
throw $e; |
| 2030 |
|
} |
| 2031 |
|
} |
| 2032 |
|
|
| 2033 |
|
/** |
| 2034 |
|
* Delete translation from the ezcontentobject_name table. |