| @@ 2098-2121 (lines=24) @@ | ||
| 2095 | * @param int $contentId |
|
| 2096 | * @param int $versionNo (optional) filter by versionNo |
|
| 2097 | */ |
|
| 2098 | public function deleteTranslatedFields($languageCode, $contentId, $versionNo = null) |
|
| 2099 | { |
|
| 2100 | $query = $this->connection->createQueryBuilder(); |
|
| 2101 | $query |
|
| 2102 | ->delete('ezcontentobject_attribute') |
|
| 2103 | ->where('contentobject_id = :contentId') |
|
| 2104 | ->andWhere('language_code = :languageCode') |
|
| 2105 | ->setParameters( |
|
| 2106 | [ |
|
| 2107 | ':contentId' => $contentId, |
|
| 2108 | ':languageCode' => $languageCode, |
|
| 2109 | ] |
|
| 2110 | ) |
|
| 2111 | ; |
|
| 2112 | ||
| 2113 | if (null !== $versionNo) { |
|
| 2114 | $query |
|
| 2115 | ->andWhere('version = :versionNo') |
|
| 2116 | ->setParameter(':versionNo', $versionNo) |
|
| 2117 | ; |
|
| 2118 | } |
|
| 2119 | ||
| 2120 | $query->execute(); |
|
| 2121 | } |
|
| 2122 | ||
| 2123 | /** |
|
| 2124 | * Delete the specified Translation from the given Version. |
|
| @@ 2154-2177 (lines=24) @@ | ||
| 2151 | * @param string $languageCode |
|
| 2152 | * @param int $versionNo optional, if specified, apply to this Version only. |
|
| 2153 | */ |
|
| 2154 | private function deleteTranslationFromContentNames($contentId, $languageCode, $versionNo = null) |
|
| 2155 | { |
|
| 2156 | $query = $this->connection->createQueryBuilder(); |
|
| 2157 | $query |
|
| 2158 | ->delete('ezcontentobject_name') |
|
| 2159 | ->where('contentobject_id=:contentId') |
|
| 2160 | ->andWhere('real_translation=:languageCode') |
|
| 2161 | ->setParameters( |
|
| 2162 | [ |
|
| 2163 | ':languageCode' => $languageCode, |
|
| 2164 | ':contentId' => $contentId, |
|
| 2165 | ] |
|
| 2166 | ) |
|
| 2167 | ; |
|
| 2168 | ||
| 2169 | if (null !== $versionNo) { |
|
| 2170 | $query |
|
| 2171 | ->andWhere('content_version = :versionNo') |
|
| 2172 | ->setParameter(':versionNo', $versionNo) |
|
| 2173 | ; |
|
| 2174 | } |
|
| 2175 | ||
| 2176 | $query->execute(); |
|
| 2177 | } |
|
| 2178 | ||
| 2179 | /** |
|
| 2180 | * Remove language from language_mask of ezcontentobject. |
|