Code Duplication    Length = 24-24 lines in 2 locations

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

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