| @@ 2050-2073 (lines=24) @@ | ||
| 2047 | * @param string $languageCode |
|
| 2048 | * @param int $versionNo optional, if specified, apply to this Version only. |
|
| 2049 | */ |
|
| 2050 | private function deleteTranslationFromContentNames($contentId, $languageCode, $versionNo = null) |
|
| 2051 | { |
|
| 2052 | $query = $this->connection->createQueryBuilder(); |
|
| 2053 | $query |
|
| 2054 | ->delete('ezcontentobject_name') |
|
| 2055 | ->where('contentobject_id=:contentId') |
|
| 2056 | ->andWhere('real_translation=:languageCode') |
|
| 2057 | ->setParameters( |
|
| 2058 | [ |
|
| 2059 | ':languageCode' => $languageCode, |
|
| 2060 | ':contentId' => $contentId, |
|
| 2061 | ] |
|
| 2062 | ) |
|
| 2063 | ; |
|
| 2064 | ||
| 2065 | if (null !== $versionNo) { |
|
| 2066 | $query |
|
| 2067 | ->andWhere('content_version = :versionNo') |
|
| 2068 | ->setParameter(':versionNo', $versionNo) |
|
| 2069 | ; |
|
| 2070 | } |
|
| 2071 | ||
| 2072 | $query->execute(); |
|
| 2073 | } |
|
| 2074 | ||
| 2075 | /** |
|
| 2076 | * Remove language from language_mask of ezcontentobject. |
|
| @@ 1994-2017 (lines=24) @@ | ||
| 1991 | * @param int $contentId |
|
| 1992 | * @param int $versionNo (optional) filter by versionNo |
|
| 1993 | */ |
|
| 1994 | public function deleteTranslatedFields($languageCode, $contentId, $versionNo = null) |
|
| 1995 | { |
|
| 1996 | $query = $this->connection->createQueryBuilder(); |
|
| 1997 | $query |
|
| 1998 | ->delete('ezcontentobject_attribute') |
|
| 1999 | ->where('contentobject_id = :contentId') |
|
| 2000 | ->andWhere('language_code = :languageCode') |
|
| 2001 | ->setParameters( |
|
| 2002 | [ |
|
| 2003 | ':contentId' => $contentId, |
|
| 2004 | ':languageCode' => $languageCode, |
|
| 2005 | ] |
|
| 2006 | ) |
|
| 2007 | ; |
|
| 2008 | ||
| 2009 | if (null !== $versionNo) { |
|
| 2010 | $query |
|
| 2011 | ->andWhere('version = :versionNo') |
|
| 2012 | ->setParameter(':versionNo', $versionNo) |
|
| 2013 | ; |
|
| 2014 | } |
|
| 2015 | ||
| 2016 | $query->execute(); |
|
| 2017 | } |
|
| 2018 | ||
| 2019 | /** |
|
| 2020 | * Delete the specified Translation from the given Version. |
|