| @@ 2110-2133 (lines=24) @@ | ||
| 2107 | * @param int $contentId |
|
| 2108 | * @param int $versionNo (optional) filter by versionNo |
|
| 2109 | */ |
|
| 2110 | public function deleteTranslatedFields($languageCode, $contentId, $versionNo = null) |
|
| 2111 | { |
|
| 2112 | $query = $this->connection->createQueryBuilder(); |
|
| 2113 | $query |
|
| 2114 | ->delete('ezcontentobject_attribute') |
|
| 2115 | ->where('contentobject_id = :contentId') |
|
| 2116 | ->andWhere('language_code = :languageCode') |
|
| 2117 | ->setParameters( |
|
| 2118 | [ |
|
| 2119 | ':contentId' => $contentId, |
|
| 2120 | ':languageCode' => $languageCode, |
|
| 2121 | ] |
|
| 2122 | ) |
|
| 2123 | ; |
|
| 2124 | ||
| 2125 | if (null !== $versionNo) { |
|
| 2126 | $query |
|
| 2127 | ->andWhere('version = :versionNo') |
|
| 2128 | ->setParameter(':versionNo', $versionNo) |
|
| 2129 | ; |
|
| 2130 | } |
|
| 2131 | ||
| 2132 | $query->execute(); |
|
| 2133 | } |
|
| 2134 | ||
| 2135 | /** |
|
| 2136 | * Delete the specified Translation from the given Version. |
|
| @@ 2166-2189 (lines=24) @@ | ||
| 2163 | * @param string $languageCode |
|
| 2164 | * @param int $versionNo optional, if specified, apply to this Version only. |
|
| 2165 | */ |
|
| 2166 | private function deleteTranslationFromContentNames($contentId, $languageCode, $versionNo = null) |
|
| 2167 | { |
|
| 2168 | $query = $this->connection->createQueryBuilder(); |
|
| 2169 | $query |
|
| 2170 | ->delete('ezcontentobject_name') |
|
| 2171 | ->where('contentobject_id=:contentId') |
|
| 2172 | ->andWhere('real_translation=:languageCode') |
|
| 2173 | ->setParameters( |
|
| 2174 | [ |
|
| 2175 | ':languageCode' => $languageCode, |
|
| 2176 | ':contentId' => $contentId, |
|
| 2177 | ] |
|
| 2178 | ) |
|
| 2179 | ; |
|
| 2180 | ||
| 2181 | if (null !== $versionNo) { |
|
| 2182 | $query |
|
| 2183 | ->andWhere('content_version = :versionNo') |
|
| 2184 | ->setParameter(':versionNo', $versionNo) |
|
| 2185 | ; |
|
| 2186 | } |
|
| 2187 | ||
| 2188 | $query->execute(); |
|
| 2189 | } |
|
| 2190 | ||
| 2191 | /** |
|
| 2192 | * Remove language from language_mask of ezcontentobject. |
|