Code Duplication    Length = 24-24 lines in 2 locations

eZ/Publish/Core/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php 2 locations

@@ 1984-2007 (lines=24) @@
1981
     * @param int $contentId
1982
     * @param int $versionNo (optional) filter by versionNo
1983
     */
1984
    public function deleteTranslatedFields($languageCode, $contentId, $versionNo = null)
1985
    {
1986
        $query = $this->connection->createQueryBuilder();
1987
        $query
1988
            ->delete('ezcontentobject_attribute')
1989
            ->where('contentobject_id = :contentId')
1990
            ->andWhere('language_code = :languageCode')
1991
            ->setParameters(
1992
                [
1993
                    ':contentId' => $contentId,
1994
                    ':languageCode' => $languageCode,
1995
                ]
1996
            )
1997
        ;
1998
1999
        if (null !== $versionNo) {
2000
            $query
2001
                ->andWhere('version = :versionNo')
2002
                ->setParameter(':versionNo', $versionNo)
2003
            ;
2004
        }
2005
2006
        $query->execute();
2007
    }
2008
2009
    /**
2010
     * Delete the specified Translation from the given Version.
@@ 2040-2063 (lines=24) @@
2037
     * @param string $languageCode
2038
     * @param int $versionNo optional, if specified, apply to this Version only.
2039
     */
2040
    private function deleteTranslationFromContentNames($contentId, $languageCode, $versionNo = null)
2041
    {
2042
        $query = $this->connection->createQueryBuilder();
2043
        $query
2044
            ->delete('ezcontentobject_name')
2045
            ->where('contentobject_id=:contentId')
2046
            ->andWhere('real_translation=:languageCode')
2047
            ->setParameters(
2048
                [
2049
                    ':languageCode' => $languageCode,
2050
                    ':contentId' => $contentId,
2051
                ]
2052
            )
2053
        ;
2054
2055
        if (null !== $versionNo) {
2056
            $query
2057
                ->andWhere('content_version = :versionNo')
2058
                ->setParameter(':versionNo', $versionNo)
2059
            ;
2060
        }
2061
2062
        $query->execute();
2063
    }
2064
2065
    /**
2066
     * Remove language from language_mask of ezcontentobject.