|
@@ 2123-2138 (lines=16) @@
|
| 2120 |
|
* @param string $languageCode language code of the translation |
| 2121 |
|
* @throws \Doctrine\DBAL\DBALException |
| 2122 |
|
*/ |
| 2123 |
|
public function deleteTranslationFromContent($contentId, $languageCode) |
| 2124 |
|
{ |
| 2125 |
|
$language = $this->languageHandler->loadByLanguageCode($languageCode); |
| 2126 |
|
|
| 2127 |
|
$this->connection->beginTransaction(); |
| 2128 |
|
try { |
| 2129 |
|
$this->deleteTranslationFromContentVersions($contentId, $language->id); |
| 2130 |
|
$this->deleteTranslationFromContentNames($contentId, $languageCode); |
| 2131 |
|
$this->deleteTranslationFromContentObject($contentId, $language->id); |
| 2132 |
|
|
| 2133 |
|
$this->connection->commit(); |
| 2134 |
|
} catch (DBALException $e) { |
| 2135 |
|
$this->connection->rollBack(); |
| 2136 |
|
throw $e; |
| 2137 |
|
} |
| 2138 |
|
} |
| 2139 |
|
|
| 2140 |
|
/** |
| 2141 |
|
* Delete Content fields (attributes) for the given Translation. |
|
@@ 2181-2195 (lines=15) @@
|
| 2178 |
|
* @param string $languageCode |
| 2179 |
|
* @throws \Doctrine\DBAL\DBALException |
| 2180 |
|
*/ |
| 2181 |
|
public function deleteTranslationFromVersion($contentId, $versionNo, $languageCode) |
| 2182 |
|
{ |
| 2183 |
|
$language = $this->languageHandler->loadByLanguageCode($languageCode); |
| 2184 |
|
|
| 2185 |
|
$this->connection->beginTransaction(); |
| 2186 |
|
try { |
| 2187 |
|
$this->deleteTranslationFromContentVersions($contentId, $language->id, $versionNo); |
| 2188 |
|
$this->deleteTranslationFromContentNames($contentId, $languageCode, $versionNo); |
| 2189 |
|
|
| 2190 |
|
$this->connection->commit(); |
| 2191 |
|
} catch (DBALException $e) { |
| 2192 |
|
$this->connection->rollBack(); |
| 2193 |
|
throw $e; |
| 2194 |
|
} |
| 2195 |
|
} |
| 2196 |
|
|
| 2197 |
|
/** |
| 2198 |
|
* Delete translation from the ezcontentobject_name table. |