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

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