| @@ 2231-2254 (lines=24) @@ | ||
| 2228 | * @param int $contentId |
|
| 2229 | * @param int $versionNo (optional) filter by versionNo |
|
| 2230 | */ |
|
| 2231 | public function deleteTranslatedFields($languageCode, $contentId, $versionNo = null) |
|
| 2232 | { |
|
| 2233 | $query = $this->connection->createQueryBuilder(); |
|
| 2234 | $query |
|
| 2235 | ->delete('ezcontentobject_attribute') |
|
| 2236 | ->where('contentobject_id = :contentId') |
|
| 2237 | ->andWhere('language_code = :languageCode') |
|
| 2238 | ->setParameters( |
|
| 2239 | [ |
|
| 2240 | ':contentId' => $contentId, |
|
| 2241 | ':languageCode' => $languageCode, |
|
| 2242 | ] |
|
| 2243 | ) |
|
| 2244 | ; |
|
| 2245 | ||
| 2246 | if (null !== $versionNo) { |
|
| 2247 | $query |
|
| 2248 | ->andWhere('version = :versionNo') |
|
| 2249 | ->setParameter(':versionNo', $versionNo) |
|
| 2250 | ; |
|
| 2251 | } |
|
| 2252 | ||
| 2253 | $query->execute(); |
|
| 2254 | } |
|
| 2255 | ||
| 2256 | /** |
|
| 2257 | * Delete the specified Translation from the given Version. |
|
| @@ 2287-2310 (lines=24) @@ | ||
| 2284 | * @param string $languageCode |
|
| 2285 | * @param int $versionNo optional, if specified, apply to this Version only. |
|
| 2286 | */ |
|
| 2287 | private function deleteTranslationFromContentNames($contentId, $languageCode, $versionNo = null) |
|
| 2288 | { |
|
| 2289 | $query = $this->connection->createQueryBuilder(); |
|
| 2290 | $query |
|
| 2291 | ->delete('ezcontentobject_name') |
|
| 2292 | ->where('contentobject_id=:contentId') |
|
| 2293 | ->andWhere('real_translation=:languageCode') |
|
| 2294 | ->setParameters( |
|
| 2295 | [ |
|
| 2296 | ':languageCode' => $languageCode, |
|
| 2297 | ':contentId' => $contentId, |
|
| 2298 | ] |
|
| 2299 | ) |
|
| 2300 | ; |
|
| 2301 | ||
| 2302 | if (null !== $versionNo) { |
|
| 2303 | $query |
|
| 2304 | ->andWhere('content_version = :versionNo') |
|
| 2305 | ->setParameter(':versionNo', $versionNo) |
|
| 2306 | ; |
|
| 2307 | } |
|
| 2308 | ||
| 2309 | $query->execute(); |
|
| 2310 | } |
|
| 2311 | ||
| 2312 | /** |
|
| 2313 | * Remove language from language_mask of ezcontentobject. |
|