Code Duplication    Length = 24-24 lines in 2 locations

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

@@ 2093-2116 (lines=24) @@
2090
     * @param int $contentId
2091
     * @param int $versionNo (optional) filter by versionNo
2092
     */
2093
    public function deleteTranslatedFields($languageCode, $contentId, $versionNo = null)
2094
    {
2095
        $query = $this->connection->createQueryBuilder();
2096
        $query
2097
            ->delete('ezcontentobject_attribute')
2098
            ->where('contentobject_id = :contentId')
2099
            ->andWhere('language_code = :languageCode')
2100
            ->setParameters(
2101
                [
2102
                    ':contentId' => $contentId,
2103
                    ':languageCode' => $languageCode,
2104
                ]
2105
            )
2106
        ;
2107
2108
        if (null !== $versionNo) {
2109
            $query
2110
                ->andWhere('version = :versionNo')
2111
                ->setParameter(':versionNo', $versionNo)
2112
            ;
2113
        }
2114
2115
        $query->execute();
2116
    }
2117
2118
    /**
2119
     * Delete the specified Translation from the given Version.
@@ 2149-2172 (lines=24) @@
2146
     * @param string $languageCode
2147
     * @param int $versionNo optional, if specified, apply to this Version only.
2148
     */
2149
    private function deleteTranslationFromContentNames($contentId, $languageCode, $versionNo = null)
2150
    {
2151
        $query = $this->connection->createQueryBuilder();
2152
        $query
2153
            ->delete('ezcontentobject_name')
2154
            ->where('contentobject_id=:contentId')
2155
            ->andWhere('real_translation=:languageCode')
2156
            ->setParameters(
2157
                [
2158
                    ':languageCode' => $languageCode,
2159
                    ':contentId' => $contentId,
2160
                ]
2161
            )
2162
        ;
2163
2164
        if (null !== $versionNo) {
2165
            $query
2166
                ->andWhere('content_version = :versionNo')
2167
                ->setParameter(':versionNo', $versionNo)
2168
            ;
2169
        }
2170
2171
        $query->execute();
2172
    }
2173
2174
    /**
2175
     * Remove language from language_mask of ezcontentobject.