Code Duplication    Length = 23-26 lines in 2 locations

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

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

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

@@ 451-476 (lines=26) @@
448
     * @param string $textMD5
449
     * @param mixed $languageId
450
     */
451
    protected function removeTranslation($parentId, $textMD5, $languageId)
452
    {
453
        /** @var $query \eZ\Publish\Core\Persistence\Database\UpdateQuery */
454
        $query = $this->dbHandler->createUpdateQuery();
455
        $query->update(
456
            $this->dbHandler->quoteTable($this->table)
457
        )->set(
458
            $this->dbHandler->quoteColumn('lang_mask'),
459
            $query->expr->bitAnd(
460
                $this->dbHandler->quoteColumn('lang_mask'),
461
                $query->bindValue(~$languageId, null, \PDO::PARAM_INT)
462
            )
463
        )->where(
464
            $query->expr->lAnd(
465
                $query->expr->eq(
466
                    $this->dbHandler->quoteColumn('parent'),
467
                    $query->bindValue($parentId, null, \PDO::PARAM_INT)
468
                ),
469
                $query->expr->eq(
470
                    $this->dbHandler->quoteColumn('text_md5'),
471
                    $query->bindValue($textMD5, null, \PDO::PARAM_STR)
472
                )
473
            )
474
        );
475
        $query->prepare()->execute();
476
    }
477
478
    /**
479
     * Marks all entries with given $id as history entries.