|
@@ 2056-2071 (lines=16) @@
|
| 2053 |
|
* @param string $languageCode language code of the translation |
| 2054 |
|
* @throws \Doctrine\DBAL\DBALException |
| 2055 |
|
*/ |
| 2056 |
|
public function deleteTranslationFromContent($contentId, $languageCode) |
| 2057 |
|
{ |
| 2058 |
|
$language = $this->languageHandler->loadByLanguageCode($languageCode); |
| 2059 |
|
|
| 2060 |
|
$this->connection->beginTransaction(); |
| 2061 |
|
try { |
| 2062 |
|
$this->deleteTranslationFromContentVersions($contentId, $language->id); |
| 2063 |
|
$this->deleteTranslationFromContentNames($contentId, $languageCode); |
| 2064 |
|
$this->deleteTranslationFromContentObject($contentId, $language->id); |
| 2065 |
|
|
| 2066 |
|
$this->connection->commit(); |
| 2067 |
|
} catch (DBALException $e) { |
| 2068 |
|
$this->connection->rollBack(); |
| 2069 |
|
throw $e; |
| 2070 |
|
} |
| 2071 |
|
} |
| 2072 |
|
|
| 2073 |
|
/** |
| 2074 |
|
* Delete Content fields (attributes) for the given Translation. |
|
@@ 2114-2128 (lines=15) @@
|
| 2111 |
|
* @param string $languageCode |
| 2112 |
|
* @throws \Doctrine\DBAL\DBALException |
| 2113 |
|
*/ |
| 2114 |
|
public function deleteTranslationFromVersion($contentId, $versionNo, $languageCode) |
| 2115 |
|
{ |
| 2116 |
|
$language = $this->languageHandler->loadByLanguageCode($languageCode); |
| 2117 |
|
|
| 2118 |
|
$this->connection->beginTransaction(); |
| 2119 |
|
try { |
| 2120 |
|
$this->deleteTranslationFromContentVersions($contentId, $language->id, $versionNo); |
| 2121 |
|
$this->deleteTranslationFromContentNames($contentId, $languageCode, $versionNo); |
| 2122 |
|
|
| 2123 |
|
$this->connection->commit(); |
| 2124 |
|
} catch (DBALException $e) { |
| 2125 |
|
$this->connection->rollBack(); |
| 2126 |
|
throw $e; |
| 2127 |
|
} |
| 2128 |
|
} |
| 2129 |
|
|
| 2130 |
|
/** |
| 2131 |
|
* Delete translation from the ezcontentobject_name table. |