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

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