|
@@ 2154-2169 (lines=16) @@
|
| 2151 |
|
* @param string $languageCode language code of the translation |
| 2152 |
|
* @throws \Doctrine\DBAL\DBALException |
| 2153 |
|
*/ |
| 2154 |
|
public function deleteTranslationFromContent($contentId, $languageCode) |
| 2155 |
|
{ |
| 2156 |
|
$language = $this->languageHandler->loadByLanguageCode($languageCode); |
| 2157 |
|
|
| 2158 |
|
$this->connection->beginTransaction(); |
| 2159 |
|
try { |
| 2160 |
|
$this->deleteTranslationFromContentVersions($contentId, $language->id); |
| 2161 |
|
$this->deleteTranslationFromContentNames($contentId, $languageCode); |
| 2162 |
|
$this->deleteTranslationFromContentObject($contentId, $language->id); |
| 2163 |
|
|
| 2164 |
|
$this->connection->commit(); |
| 2165 |
|
} catch (DBALException $e) { |
| 2166 |
|
$this->connection->rollBack(); |
| 2167 |
|
throw $e; |
| 2168 |
|
} |
| 2169 |
|
} |
| 2170 |
|
|
| 2171 |
|
/** |
| 2172 |
|
* Delete Content fields (attributes) for the given Translation. |
|
@@ 2212-2226 (lines=15) @@
|
| 2209 |
|
* @param string $languageCode |
| 2210 |
|
* @throws \Doctrine\DBAL\DBALException |
| 2211 |
|
*/ |
| 2212 |
|
public function deleteTranslationFromVersion($contentId, $versionNo, $languageCode) |
| 2213 |
|
{ |
| 2214 |
|
$language = $this->languageHandler->loadByLanguageCode($languageCode); |
| 2215 |
|
|
| 2216 |
|
$this->connection->beginTransaction(); |
| 2217 |
|
try { |
| 2218 |
|
$this->deleteTranslationFromContentVersions($contentId, $language->id, $versionNo); |
| 2219 |
|
$this->deleteTranslationFromContentNames($contentId, $languageCode, $versionNo); |
| 2220 |
|
|
| 2221 |
|
$this->connection->commit(); |
| 2222 |
|
} catch (DBALException $e) { |
| 2223 |
|
$this->connection->rollBack(); |
| 2224 |
|
throw $e; |
| 2225 |
|
} |
| 2226 |
|
} |
| 2227 |
|
|
| 2228 |
|
/** |
| 2229 |
|
* Delete translation from the ezcontentobject_name table. |