Code Duplication    Length = 23-26 lines in 2 locations

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

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

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

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