Code Duplication    Length = 23-26 lines in 2 locations

eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway/DoctrineDatabase.php 1 location

@@ 167-189 (lines=23) @@
164
     *
165
     * @param \eZ\Publish\SPI\Persistence\Content\Type\Group\UpdateStruct $group
166
     */
167
    public function updateGroup(GroupUpdateStruct $group)
168
    {
169
        $q = $this->dbHandler->createUpdateQuery();
170
        $q->update(
171
            $this->dbHandler->quoteColumn('ezcontentclassgroup')
172
        )->set(
173
            $this->dbHandler->quoteColumn('modified'),
174
            $q->bindValue($group->modified, null, \PDO::PARAM_INT)
175
        )->set(
176
            $this->dbHandler->quoteColumn('modifier_id'),
177
            $q->bindValue($group->modifierId, null, \PDO::PARAM_INT)
178
        )->set(
179
            $this->dbHandler->quoteColumn('name'),
180
            $q->bindValue($group->identifier)
181
        )->where(
182
            $q->expr->eq(
183
                $this->dbHandler->quoteColumn('id'),
184
                $q->bindValue($group->id, null, \PDO::PARAM_INT)
185
            )
186
        );
187
188
        $q->prepare()->execute();
189
    }
190
191
    /**
192
     * Returns the number of types in a certain group.

eZ/Publish/Core/Persistence/Legacy/Content/UrlAlias/Gateway/DoctrineDatabase.php 1 location

@@ 430-455 (lines=26) @@
427
     * @param string $textMD5
428
     * @param mixed $languageId
429
     */
430
    protected function removeTranslation($parentId, $textMD5, $languageId)
431
    {
432
        /** @var $query \eZ\Publish\Core\Persistence\Database\UpdateQuery */
433
        $query = $this->dbHandler->createUpdateQuery();
434
        $query->update(
435
            $this->dbHandler->quoteTable($this->table)
436
        )->set(
437
            $this->dbHandler->quoteColumn('lang_mask'),
438
            $query->expr->bitAnd(
439
                $this->dbHandler->quoteColumn('lang_mask'),
440
                $query->bindValue(~$languageId, null, \PDO::PARAM_INT)
441
            )
442
        )->where(
443
            $query->expr->lAnd(
444
                $query->expr->eq(
445
                    $this->dbHandler->quoteColumn('parent'),
446
                    $query->bindValue($parentId, null, \PDO::PARAM_INT)
447
                ),
448
                $query->expr->eq(
449
                    $this->dbHandler->quoteColumn('text_md5'),
450
                    $query->bindValue($textMD5, null, \PDO::PARAM_STR)
451
                )
452
            )
453
        );
454
        $query->prepare()->execute();
455
    }
456
457
    /**
458
     * Marks all entries with given $id as history entries.