|
@@ 2078-2093 (lines=16) @@
|
| 2075 |
|
* @param string $languageCode language code of the translation |
| 2076 |
|
* @throws \Doctrine\DBAL\DBALException |
| 2077 |
|
*/ |
| 2078 |
|
public function deleteTranslationFromContent($contentId, $languageCode) |
| 2079 |
|
{ |
| 2080 |
|
$language = $this->languageHandler->loadByLanguageCode($languageCode); |
| 2081 |
|
|
| 2082 |
|
$this->connection->beginTransaction(); |
| 2083 |
|
try { |
| 2084 |
|
$this->deleteTranslationFromContentVersions($contentId, $language->id); |
| 2085 |
|
$this->deleteTranslationFromContentNames($contentId, $languageCode); |
| 2086 |
|
$this->deleteTranslationFromContentObject($contentId, $language->id); |
| 2087 |
|
|
| 2088 |
|
$this->connection->commit(); |
| 2089 |
|
} catch (DBALException $e) { |
| 2090 |
|
$this->connection->rollBack(); |
| 2091 |
|
throw $e; |
| 2092 |
|
} |
| 2093 |
|
} |
| 2094 |
|
|
| 2095 |
|
/** |
| 2096 |
|
* Delete Content fields (attributes) for the given Translation. |
|
@@ 2136-2150 (lines=15) @@
|
| 2133 |
|
* @param string $languageCode |
| 2134 |
|
* @throws \Doctrine\DBAL\DBALException |
| 2135 |
|
*/ |
| 2136 |
|
public function deleteTranslationFromVersion($contentId, $versionNo, $languageCode) |
| 2137 |
|
{ |
| 2138 |
|
$language = $this->languageHandler->loadByLanguageCode($languageCode); |
| 2139 |
|
|
| 2140 |
|
$this->connection->beginTransaction(); |
| 2141 |
|
try { |
| 2142 |
|
$this->deleteTranslationFromContentVersions($contentId, $language->id, $versionNo); |
| 2143 |
|
$this->deleteTranslationFromContentNames($contentId, $languageCode, $versionNo); |
| 2144 |
|
|
| 2145 |
|
$this->connection->commit(); |
| 2146 |
|
} catch (DBALException $e) { |
| 2147 |
|
$this->connection->rollBack(); |
| 2148 |
|
throw $e; |
| 2149 |
|
} |
| 2150 |
|
} |
| 2151 |
|
|
| 2152 |
|
/** |
| 2153 |
|
* Delete translation from the ezcontentobject_name table. |