Code Duplication    Length = 20-24 lines in 2 locations

eZ/Publish/Core/Persistence/Legacy/Content/UrlAlias/Gateway/DoctrineDatabase.php 2 locations

@@ 487-506 (lines=20) @@
484
     * @param string $textMD5
485
     * @param array $values associative array with column names as keys and column values as values
486
     */
487
    public function updateRow($parentId, $textMD5, array $values)
488
    {
489
        /** @var $query \eZ\Publish\Core\Persistence\Database\UpdateQuery */
490
        $query = $this->dbHandler->createUpdateQuery();
491
        $query->update($this->dbHandler->quoteTable('ezurlalias_ml'));
492
        $this->setQueryValues($query, $values);
493
        $query->where(
494
            $query->expr->lAnd(
495
                $query->expr->eq(
496
                    $this->dbHandler->quoteColumn('parent'),
497
                    $query->bindValue($parentId, null, \PDO::PARAM_INT)
498
                ),
499
                $query->expr->eq(
500
                    $this->dbHandler->quoteColumn('text_md5'),
501
                    $query->bindValue($textMD5, null, \PDO::PARAM_STR)
502
                )
503
            )
504
        );
505
        $query->prepare()->execute();
506
    }
507
508
    /**
509
     * Inserts new row in urlalias_ml table.
@@ 637-660 (lines=24) @@
634
     *
635
     * @return array
636
     */
637
    public function loadRow($parentId, $textMD5)
638
    {
639
        /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */
640
        $query = $this->dbHandler->createSelectQuery();
641
        $query->select('*')->from(
642
            $this->dbHandler->quoteTable('ezurlalias_ml')
643
        )->where(
644
            $query->expr->lAnd(
645
                $query->expr->eq(
646
                    $this->dbHandler->quoteColumn('parent'),
647
                    $query->bindValue($parentId, null, \PDO::PARAM_INT)
648
                ),
649
                $query->expr->eq(
650
                    $this->dbHandler->quoteColumn('text_md5'),
651
                    $query->bindValue($textMD5, null, \PDO::PARAM_STR)
652
                )
653
            )
654
        );
655
656
        $statement = $query->prepare();
657
        $statement->execute();
658
659
        return $statement->fetch(\PDO::FETCH_ASSOC);
660
    }
661
662
    /**
663
     * Loads complete URL alias data by given array of path hashes.