| @@ 2148-2171 (lines=24) @@ | ||
| 2145 | * @param int $contentId |
|
| 2146 | * @param int $versionNo (optional) filter by versionNo |
|
| 2147 | */ |
|
| 2148 | public function deleteTranslatedFields($languageCode, $contentId, $versionNo = null) |
|
| 2149 | { |
|
| 2150 | $query = $this->connection->createQueryBuilder(); |
|
| 2151 | $query |
|
| 2152 | ->delete('ezcontentobject_attribute') |
|
| 2153 | ->where('contentobject_id = :contentId') |
|
| 2154 | ->andWhere('language_code = :languageCode') |
|
| 2155 | ->setParameters( |
|
| 2156 | [ |
|
| 2157 | ':contentId' => $contentId, |
|
| 2158 | ':languageCode' => $languageCode, |
|
| 2159 | ] |
|
| 2160 | ) |
|
| 2161 | ; |
|
| 2162 | ||
| 2163 | if (null !== $versionNo) { |
|
| 2164 | $query |
|
| 2165 | ->andWhere('version = :versionNo') |
|
| 2166 | ->setParameter(':versionNo', $versionNo) |
|
| 2167 | ; |
|
| 2168 | } |
|
| 2169 | ||
| 2170 | $query->execute(); |
|
| 2171 | } |
|
| 2172 | ||
| 2173 | /** |
|
| 2174 | * Delete the specified Translation from the given Version. |
|
| @@ 2204-2227 (lines=24) @@ | ||
| 2201 | * @param string $languageCode |
|
| 2202 | * @param int $versionNo optional, if specified, apply to this Version only. |
|
| 2203 | */ |
|
| 2204 | private function deleteTranslationFromContentNames($contentId, $languageCode, $versionNo = null) |
|
| 2205 | { |
|
| 2206 | $query = $this->connection->createQueryBuilder(); |
|
| 2207 | $query |
|
| 2208 | ->delete('ezcontentobject_name') |
|
| 2209 | ->where('contentobject_id=:contentId') |
|
| 2210 | ->andWhere('real_translation=:languageCode') |
|
| 2211 | ->setParameters( |
|
| 2212 | [ |
|
| 2213 | ':languageCode' => $languageCode, |
|
| 2214 | ':contentId' => $contentId, |
|
| 2215 | ] |
|
| 2216 | ) |
|
| 2217 | ; |
|
| 2218 | ||
| 2219 | if (null !== $versionNo) { |
|
| 2220 | $query |
|
| 2221 | ->andWhere('content_version = :versionNo') |
|
| 2222 | ->setParameter(':versionNo', $versionNo) |
|
| 2223 | ; |
|
| 2224 | } |
|
| 2225 | ||
| 2226 | $query->execute(); |
|
| 2227 | } |
|
| 2228 | ||
| 2229 | /** |
|
| 2230 | * Remove language from language_mask of ezcontentobject. |
|