|
@@ 2206-2221 (lines=16) @@
|
| 2203 |
|
* @param string $languageCode language code of the translation |
| 2204 |
|
* @throws \Doctrine\DBAL\DBALException |
| 2205 |
|
*/ |
| 2206 |
|
public function deleteTranslationFromContent($contentId, $languageCode) |
| 2207 |
|
{ |
| 2208 |
|
$language = $this->languageHandler->loadByLanguageCode($languageCode); |
| 2209 |
|
|
| 2210 |
|
$this->connection->beginTransaction(); |
| 2211 |
|
try { |
| 2212 |
|
$this->deleteTranslationFromContentVersions($contentId, $language->id); |
| 2213 |
|
$this->deleteTranslationFromContentNames($contentId, $languageCode); |
| 2214 |
|
$this->deleteTranslationFromContentObject($contentId, $language->id); |
| 2215 |
|
|
| 2216 |
|
$this->connection->commit(); |
| 2217 |
|
} catch (DBALException $e) { |
| 2218 |
|
$this->connection->rollBack(); |
| 2219 |
|
throw $e; |
| 2220 |
|
} |
| 2221 |
|
} |
| 2222 |
|
|
| 2223 |
|
/** |
| 2224 |
|
* Delete Content fields (attributes) for the given Translation. |
|
@@ 2264-2278 (lines=15) @@
|
| 2261 |
|
* @param string $languageCode |
| 2262 |
|
* @throws \Doctrine\DBAL\DBALException |
| 2263 |
|
*/ |
| 2264 |
|
public function deleteTranslationFromVersion($contentId, $versionNo, $languageCode) |
| 2265 |
|
{ |
| 2266 |
|
$language = $this->languageHandler->loadByLanguageCode($languageCode); |
| 2267 |
|
|
| 2268 |
|
$this->connection->beginTransaction(); |
| 2269 |
|
try { |
| 2270 |
|
$this->deleteTranslationFromContentVersions($contentId, $language->id, $versionNo); |
| 2271 |
|
$this->deleteTranslationFromContentNames($contentId, $languageCode, $versionNo); |
| 2272 |
|
|
| 2273 |
|
$this->connection->commit(); |
| 2274 |
|
} catch (DBALException $e) { |
| 2275 |
|
$this->connection->rollBack(); |
| 2276 |
|
throw $e; |
| 2277 |
|
} |
| 2278 |
|
} |
| 2279 |
|
|
| 2280 |
|
/** |
| 2281 |
|
* Delete translation from the ezcontentobject_name table. |