|
@@ 2104-2119 (lines=16) @@
|
| 2101 |
|
* @param string $languageCode language code of the translation |
| 2102 |
|
* @throws \Doctrine\DBAL\DBALException |
| 2103 |
|
*/ |
| 2104 |
|
public function deleteTranslationFromContent($contentId, $languageCode) |
| 2105 |
|
{ |
| 2106 |
|
$language = $this->languageHandler->loadByLanguageCode($languageCode); |
| 2107 |
|
|
| 2108 |
|
$this->connection->beginTransaction(); |
| 2109 |
|
try { |
| 2110 |
|
$this->deleteTranslationFromContentVersions($contentId, $language->id); |
| 2111 |
|
$this->deleteTranslationFromContentNames($contentId, $languageCode); |
| 2112 |
|
$this->deleteTranslationFromContentObject($contentId, $language->id); |
| 2113 |
|
|
| 2114 |
|
$this->connection->commit(); |
| 2115 |
|
} catch (DBALException $e) { |
| 2116 |
|
$this->connection->rollBack(); |
| 2117 |
|
throw $e; |
| 2118 |
|
} |
| 2119 |
|
} |
| 2120 |
|
|
| 2121 |
|
/** |
| 2122 |
|
* Delete Content fields (attributes) for the given Translation. |
|
@@ 2162-2176 (lines=15) @@
|
| 2159 |
|
* @param string $languageCode |
| 2160 |
|
* @throws \Doctrine\DBAL\DBALException |
| 2161 |
|
*/ |
| 2162 |
|
public function deleteTranslationFromVersion($contentId, $versionNo, $languageCode) |
| 2163 |
|
{ |
| 2164 |
|
$language = $this->languageHandler->loadByLanguageCode($languageCode); |
| 2165 |
|
|
| 2166 |
|
$this->connection->beginTransaction(); |
| 2167 |
|
try { |
| 2168 |
|
$this->deleteTranslationFromContentVersions($contentId, $language->id, $versionNo); |
| 2169 |
|
$this->deleteTranslationFromContentNames($contentId, $languageCode, $versionNo); |
| 2170 |
|
|
| 2171 |
|
$this->connection->commit(); |
| 2172 |
|
} catch (DBALException $e) { |
| 2173 |
|
$this->connection->rollBack(); |
| 2174 |
|
throw $e; |
| 2175 |
|
} |
| 2176 |
|
} |
| 2177 |
|
|
| 2178 |
|
/** |
| 2179 |
|
* Delete translation from the ezcontentobject_name table. |